What does the Object.freeze() method do?

JavaScript Associate Easy

JavaScript Associate — Easy

What does the Object.freeze() method do?

Key points

  • Object.freeze() affects the object's own properties directly
  • It prevents property additions, deletions, and modifications
  • The method does not create a new object or copy
  • It does not alter the object's prototype chain
  • Object.freeze() makes the object immutable

Ready to go further?

Related questions