Last active
September 10, 2016 15:48
-
-
Save dengjonathan/5821d2b939c85ad83120fbbd334fff0e to your computer and use it in GitHub Desktop.
for loop
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 names = ['jon', 'jane', 'jack']; | |
// something we want to do with each item in array | |
var log = function(a) { | |
console.log(a); | |
} | |
// using for loop | |
for (var i = 0; i < names.length; i++) { | |
log(names[i]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment