JS: Enumerable Property

By Xah Lee. Date: . Last updated: .

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

JavaScript. Define Properties and attributes.