Loops/Foreach: Difference between revisions

(add E example)
Line 96:
This works for any object, as well as arrays.
<lang JavaScript>for (var a in o) print(o[a]);</lang>
However, it has the often unwanted feature that it lists inherited properties and methods of objects as well as the ones directly set on the object -- consider whether to filter out such properties inside the loop.
 
=={{header|Logo}}==
Anonymous user