I don't understand writable and configurable property attributes of Objects

后端 未结 4 987
我在风中等你
我在风中等你 2021-01-19 11:10

I don\'t understand the Writable and Configurable attributes of Objects. For example, in the MDN for Object.prototype, there is a table where I can clearly see that Configur

4条回答
  •  灰色年华
    2021-01-19 11:36

    From: http://ejohn.org/blog/ecmascript-5-objects-and-properties/

    Writable: If false, the value of the property can not be changed.

    Configurable: If false, any attempts to delete the property or change its attributes (Writable, Configurable, or Enumerable) will fail.

    Enumerable: If true, the property will be iterated over when a user does for (var prop in obj){} (or similar).

提交回复
热议问题