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 if the item should be included in loop or iterations.

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