Last active
September 10, 2016 15:48
Revisions
-
dengjonathan revised this gist
Sep 10, 2016 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,3 @@ var names = ['jon', 'jane', 'jack']; // something we want to do with each item in array -
dengjonathan revised this gist
Sep 10, 2016 . No changes.There are no files selected for viewing
-
dengjonathan created this gist
Sep 10, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ // This script reimplements JavaScript's native Array.prototype.forEach 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]); }