JS: Property Attributes, writable, enumerable, configurable

By Xah Lee. Date: . Last updated: .

Property Attributes

Each property has associated info called attribute.

Data Property Attributes

Data Property Attributes
attribute namemeaning
value The property's value.
writable When true, the property's value can be changed.
enumerable When true, the property shows in some loop constructs, such as for-in Loop. [see JS: Access Property]
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

JS: Getter/Setter Properties

[see JS: Property Overview]

Show Property Attributes

check Property's Enumerable Attribute

One convenient function is obj.propertyIsEnumerable(p).

JS: Object.prototype.propertyIsEnumerable

Set Property Attributes

JS: Object.defineProperty

Set Multiple Properties Attributes

JS: Object.defineProperties

JS Object Property

  1. Property Overview
  2. Property Key
  3. Dot vs Bracket Notation
  4. Create/Delete Property
  5. Get/Set Property
  6. Property Existence
  7. Access Property
  8. List Properties
  9. Property Attributes
  10. Getter/Setter
  11. Property Descriptor
  12. Symbol
Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials