Object.create method in javascript

后端 未结 2 1152
你的背包
你的背包 2021-01-18 09:09

Being a beginner in javascript, i tried to understand Object.create() method from here

https://developer-new.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objec

2条回答
  •  遇见更好的自我
    2021-01-18 10:01

    Late answer, not looking for votes, but hoping this will be helpful.

    There are two kinds of properties. Each property is EITHER:

    1. a data property which has these four attributes:

      • value
      • writable
      • enumerable
      • configurable
    2. OR an accessor property which has these four attributes:

      • get
      • set
      • enumerable
      • configurable

    Therefore there is no property that can have both get and writable. That's just the way JavaScript is! Please see section 8.6 of the ECMAScript Standard for the gory details.

提交回复
热议问题