What is the output?
const o = Object.freeze({ n: 1 });
o.n = 2;
console.log(o.n);
- 1
- 2
- undefined
- TypeError
In non-strict code the write on a frozen object fails silently.
Play Problem Solving ▸
const o = Object.freeze({ n: 1 });
o.n = 2;
console.log(o.n);