0

Question: What is the value of foo.x?

My guess should be the same as foo, which should point to {n:2}. but when I run it through node, if give me undefined. Why?

var foo = {n: 1};
var bar = foo;
foo.x = foo = {n: 2};
Downhillski
  • 2,381
  • 2
  • 25
  • 37

0 Answers0