Difference between Configurable and Writable attributes of an Object

后端 未结 4 1950
情歌与酒
情歌与酒 2020-12-29 23:27

I saw the following regarding javascript, object data property attributes

— 
Configurable: Specifies whether the property can be deleted or changed.

— Enume

4条回答
  •  我在风中等你
    2020-12-30 00:07

    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).

提交回复
热议问题