/Dean Edwards

About Dean Edwards

Enumerating JavaScript Objects

2010-05-25T22:57:38+00:00 August 22nd, 2006|JavaScript|

The global forEach function allows us to enumerate any object according to it’s type. If the object is array-like (has a length property) then we enumerate it like an array. All other objects are enumerated using the standard for var x in y mechanism.