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 if the item should be included in loop or iterations.
For example, Array has
a property length, which has enumerable attribute false.
Note: the enumerable attribute is bad design of JavaScript. It is the result of mixing array and object into one. For array elements, we want loop to go over, but for methods in objects, we don't. Therefore enumerable attribute was created to indicate which is which.