confirurable: 可配置; 还可以包含 set, get 访问器方法; 其中,[set, get] 与 value 和 writable 不能同时出现;
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
* 原型模式使用 * Object.create * **/ const person = { isHuman: false, printIntroduction: function() { console.log(`My name is ${this.name}. Am I human? ${this.isHuman}`); } };
const me = Object.create(person);
me.name = 'Matthew'; // "name" is a property set on "me", but not on "person" me.isHuman = true; // inherited properties can be overwritten
me.printIntroduction(); // expected output: "My name is Matthew. Am I human? true"