Skip to main content

Timeline for Loop through an array in JavaScript

Current License: CC BY-SA 4.0

5 events
when toggle format what by license comment
Sep 28, 2019 at 22:14 history edited Peter Mortensen CC BY-SA 4.0
Active reading [<https://en.wikipedia.org/wiki/JavaScript>].
Mar 20, 2014 at 14:17 comment added daniel1426 The loop condition could be (item=someArray[i]) !== undefined.
Mar 1, 2013 at 12:13 history edited Stijn de Witt CC BY-SA 3.0
Incorporated comment of CMS in the answer
Feb 28, 2013 at 18:31 comment added Christian C. Salvadó Notice that with this approach the loop will stop as soon it finds a falsey value, such as an empty string, 0, false, NaN, null or undefined, even before i reaches the length, e.g.: jsfiddle.net/prvzk/1
Feb 28, 2013 at 13:59 history answered Stijn de Witt CC BY-SA 3.0