Object.preventExtensions, seal, and freeze
In this lesson, we’ll cover three functions that allow us to enforce functional programming. Each of these functions makes our object inflexible to varying degrees. We can prevent property addition, or we can freeze an object entirely.
This is a function that helps us approach immutability. Once it’s called on an object, we can’t add anything to it.
Deletions and changes are still allowed. Only property addition is forbidden.