Press "Enter" to skip to content

Freeze objects in javascript

Sharing is caring!

You would definitely like this method in case you want to prevent changes in properties of an object. It means,

  1. No addition
  2. No removing
  3. Not updatable

Not only in its properties, this also applies to its prototype.

Everything is awesome.