var obj = {
b: 2
};
console.log(obj.a);
console.log(obj);
obj.a = 1;
console.log(obj);
The three console.log() outputs the following results:
The first undefined
I can understand, but the second one can output a:1
, and it can be seen that the second and third printing results have a distinct difference:
Why has the first parenthesis only b:2
, and the second full output?