Created
November 25, 2015 18:08
-
-
Save abrjagad/af65a736b63c58557b6f to your computer and use it in GitHub Desktop.
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
(function () { | |
function log(x) { | |
console.log('My value: ' + x); | |
} | |
var funcs = []; | |
for (var i = 0; i < 3; i++) { | |
funcs[i] = log.bind(null, i); | |
} | |
for (var j = 0; j < 3; j++) { | |
funcs[j](); | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment