JS: Enumerable Property
What is Enumerable Property
A Enumerable Property is a property whose
Property Attribute
enumerable
is true.
Purpose of Enumerable Attribute
It indicates whether the property is part of a list kind of thing.
Many loop or iteration functions going thru object properties will only list the property if it is enumerable.
For example, Array has
a property length, which has enumerable attribute false.
Note: basically, the enumerable attribute is just bad design of JavaScript. It is the result of mixing array, dictionary, and struct, types into one.
Check If Property is Enumerable
JavaScript. Property
- JS: Property Overview
- JS: Order of Properties
- JS: Property Key
- JS: Property Dot Notation vs Bracket Notation
- JS: Create Property
- JS: Delete Property
- JS: Get Set Property
- JS: Check Property Existence
- JS: Access Property
- JS: List Properties
- JS: for-in Loop ❌
- JS: Enumerable Property
- JS: Property Attributes
- JS: Property Descriptor
- JS: Getter / Setter Property
JavaScript. Define Properties and attributes.
- JS: Property Attributes
- JS: Enumerable Property
- JS: Property Descriptor
- JS: Object.create
- JS: Object.defineProperty ❌
- JS: Reflect.defineProperty
- JS: Object.defineProperties
- JS: Object.prototype.propertyIsEnumerable ❌
- JS: Object.getOwnPropertyDescriptor ❌
- JS: Reflect.getOwnPropertyDescriptor
- JS: Object.getOwnPropertyDescriptors