Created
September 26, 2012 21:52
-
-
Save cecilemuller/3790859 to your computer and use it in GitHub Desktop.
Shorthand to iterate thru an array and get the current element in a variable, in pure Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myArray = ["aaaaa", "bbbbb", "ccccc"]; | |
for (var i = 0, oneItem; oneItem = myArray[i]; i++){ | |
console.log( oneItem ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment