$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #108

What is the output?

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