1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Prevent adding/deleting properties in a JavaScript object with Object.seal() method

    javascriptJavaScript

    Sometimes it's necessary to have a fixed set of properties on a JavaScript object, while also maintaining the option of changing those properties.

    In this lesson we are going to learn how to use Object.seal() method to prevent new properties from being added to it and marking all existing properties as non-configurable. Values of present properties can still be changed.