What is the final value of "obj" in the following example?

What is the final value of “obj” in the following example?

const obj = { foo: 1 };
obj.bar = 2;
{ foo: 1 }
{ foo: 1, bar: 2 }
{ foo: 1, 2: bar }
None of the above

1 Like

the correct ans is { foo: 1, bar: 2 }

2 Likes

option 2 is correct.

1 Like