Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
freeze(object)
object
Object to freeze.
The object that was passed to the function.
let obj = {cheese: "like", milk: "dislike"}
Object.freeze(obj)
obj.cheese = "dislike" // will have no effect
obj.cheese
"like"