const person = {name: '啦啦德玛西亚',_job: '无业'}Object.defineProperty(person, 'job', {get: function() {return this._job},set: function(newValue) {this._job = newValue}})console.log(Object.isFrozen(person))// false//使用Object.freeze()将对象修改为冻结对象,//冻结对象即无法扩展,又是密封的,而且对象的数据属性的[[Writable]]特性会被设置为falseObject.freeze(person)//使用Object.isFrozen()检测对象是否是冻结对象//因为冻结对象既是密封又是不可扩展的,//所以用Object.isExtensible()为false,Object.isSealed()为trueconsole.log(Object.isFrozen(person))// trueconsole.log(Object.isExtensible(person))// falseconsole.log(Object.isSealed(person))// trueperson.age = 20console.log(person.age)// undefinedperson.name = '德玛西亚万岁'console.log(person.name)// 啦啦德玛西亚delete person.nameconsole.log(person.name)// 啦啦德玛西亚console.log(person.job) // 无业person.job = '前端打字员'console.log(person.job) // 无业