4 ms·
The really fun part is doing this :)... Evaluate the expression: const x = {value: 0}; console.log(x); console.log({x}); x.value = 1; You get
by Folcon 6y ago
The really fun part is doing this :)...
Evaluate the expression:
const x = {value: 0};
console.log(x);
console.log({x});
x.value = 1;
You get this:
{value: 0}
{x: {…}}
Expand the first arrow of the `x:`:
v {x: {…}}
> x: {value: 1}
Now evaluate:
x.value = 3
Then expand the second arrow:
v {x: {…}}
> x:
value: 3
Now if you unexpand the arrow, you get 1, but if you expand it you get 3 =)... (Well at least in chrome)
- Lex-2008 6y ago> Now if you unexpand the arrow, you get 1, but if you expand it you get 3 =)... Moreover, if you expand arrow next to {value: 0}, you will see literally this: v {value: 0} [i] value: 3