JavaScript: Property Attributes: enumerable, configurable, writable, value
Property Attributes
Each property has associated info called attribute.
The attributes specify the property value, whether it can be changed, or whether it can be enumerated of function that go thru them.
Data Property Attributes
value
-
The property's value. writable
-
When true
, the property's value can be changed. enumerable
-
When
true
, the property shows in some enumeration constructs, such as for-in Loop. [see JavaScript: List Properties] configurable
-
If
false
, you can't delete the property, nor change the property attributes (example: make it configurable again), nor change it to/from get/set property. But you may still change the value.
Accessor Property's Attributes
Show Property Attributes
- Object.getOwnPropertyDescriptor
- Reflect.getOwnPropertyDescriptor
- Object.prototype.propertyIsEnumerable