关键字:seal, freeze, property descriptor. 1.Object.seal() 参考文档(2)中这样描述: The Object.seal() method seals an object, preventing new properties from being added to it and marking all existing properties as non-configurable. Values of present properties can…
let person = { firstName: "Zhentian", lastName: "Wan" }; /*Object.freeze() makes object cannot be updated, added or deleted*/ let freezePerson = Object.freeze(person); freezePerson.address="Finland"; // Cannot add property ad…
1 Object.seal(O)的调用 When the seal function is called, the following steps are taken: If Type(O) is not Object throw a TypeError exception. For each named own property name P of O, Let desc be the result of calling the [[GetOwnProperty]] int…