Object.getOwnPropertyDescriptors()方法,返回某个对象属性的描述对象。
var people = {name:'oo',age:'xx'};
Object.getOwnPropertyDescriptor(people,'name');
//{value: "oo", writable: true, enumerable: true, configurable: true}
Object.getOwnPropertyDescriptors()方法,返回指定对象所有自身属性(非继承属性)的描述对象。
Object.getOwnPropertyDescriptors(people)
//{
//age: {value: "xx", writable: true, enumerable: true, configurable: true},
//name:{value: "oo", writable: true, enumerable: true, configurable: true}
//}