Tag Archives: loop

loop through array in ES5

If you’re using an environment that supports the Array features of ES5 (directly or using a shim), you can use the new forEach function: var a = [“a”, “b”, “c”]; a.forEach(function(entry) { console.log(entry); }); forEach accepts an iterator function and, optionally, a value to use as this when calling that iterator function (not used above). The iterator function is called for each […]


I’m stuck in an event-loop.