Intermediate JavaScript
Q45 / 100

What does Object.freeze() do?

Correct! Well done.

Incorrect.

The correct answer is B) Makes an object immutable — no properties can be added, removed, or modified

B

Correct Answer

Makes an object immutable — no properties can be added, removed, or modified

Explanation

Object.freeze(obj) prevents mutation in strict mode (silently fails in non-strict). It is shallow — nested objects can still be mutated.

Progress
45/100