Skip to main content

Timeline for Loop through an array in JavaScript

Current License: CC BY-SA 3.0

9 events
when toggle format what by license comment
Mar 8 at 9:55 comment added kdb @ChristianC.Salvadó This question now contains replies saying that ES5 cannot be relied upon and answers that use ES6 arrow notation. Are you even still on the platform? When did we get so old? 🥲
Feb 6, 2018 at 3:40 history edited Peter Mortensen CC BY-SA 3.0
Active reading [<http://en.wikipedia.org/wiki/JavaScript>]
Oct 24, 2017 at 7:36 history edited hasen CC BY-SA 3.0
Make the answer less bad.
Jul 2, 2016 at 19:52 history edited Peter Mortensen CC BY-SA 3.0
Copy edited (e.g. ref. <http://en.wikipedia.org/wiki/Python_%28programming_language%29> and <http://en.wikipedia.org/wiki/Haskell_%28programming_language%29>). Removed historical information (e.g. ref. <http://meta.stackexchange.com/a/230693>).
Dec 10, 2013 at 15:46 history edited Dan Dascalescu CC BY-SA 3.0
typo fix
Jun 10, 2010 at 0:30 comment added Christian C. Salvadó @hasen, the Array.prototype.map method is part of the ECMAScript 5th Edition Standard, is not yet available on all implementations (e.g. IE lacks of it), also for iterating over an array I think the Array.prototype.forEach method is more semantically correct... also please don't suggest the for-in statement, see my answer for more details :)
Jun 10, 2010 at 0:20 comment added harto That particular example is probably better implemented using Array.forEach. map is for generating a new array.
Jun 10, 2010 at 0:20 history edited hasen CC BY-SA 2.5
added 503 characters in body
Jun 10, 2010 at 0:09 history answered hasen CC BY-SA 2.5