es5设置属性不能修改
/*es5*/ { var Person ={ name:'es5', age:19 } Object.defineProperty(Person,'sex',{ writable:false, value:'male' }) console.table({ name:person.get('name'), age:person.get('age') }); Person.sex ='xxxx'; console.table({ name:person.get('name'), age:person.get('age') }); }
效果图: