JS: Property Attributes, writable, enumerable, configurable

By Xah Lee. Date: . Last updated: .

Property Attributes

Each property has associated info called attribute.

ECMAScript® 2016 Language Specification#sec-property-attributes

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 (e.g. 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. Check Property Existence
  7. Access Property
  8. List Properties
  9. Property Attributes
  10. Getter/Setter
  11. Property Descriptor
  12. Symbol
Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

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

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS Basics
  4. JS in Depth
  5. JS Reference
  6. DOM
  7. SVG
  8. JS Misc