Object.freeze是干嘛用的呢?看看API解释的
Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
就是说把一个对象freeze之后就不能修改存在的属性和值了,就是key value都不能修改,而且也不能添加新的属性
// Create an object that has two properties.
var obj = { name: "Nicholas", length: 10 }
// Freeze the object.
Object.freeze(obj)
// Try to add a new property, and then verify that it is not added.
obj.newProp = 50
console.log(obj.newProp) // Ouput: undefined
...