Question PRG-JS-0064
HardWhat is the output of this program?
let a = { x: 1 };
let b = a;
b.x = 2;
b = { x: 3 };
const c = Object.freeze({ y: [1] });
c.y.push(2);
console.log(a.x, b.x, c.y.length);
- A.
2 3 1
- B.
3 3 1
- C.
Sign up free to see the answer and a step-by-step explanation.