Created
July 16, 2015 17:55
-
-
Save ewilazarus/f56c4ef9030faaf2f762 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function buildFunctions() { | |
var arr = []; | |
for (var i = 0; i < 3; i++) { | |
arr.push(function() { | |
console.log(i); | |
}); | |
} | |
return arr; | |
} | |
var fs = buildFunctions(); | |
fs[0](); | |
fs[1](); | |
fs[2](); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment