Skip to content

Instantly share code, notes, and snippets.

@abrjagad
Created November 25, 2015 18:08
Show Gist options
  • Save abrjagad/af65a736b63c58557b6f to your computer and use it in GitHub Desktop.
Save abrjagad/af65a736b63c58557b6f to your computer and use it in GitHub Desktop.
(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