Skip to content

Instantly share code, notes, and snippets.

@develar
Created July 11, 2012 07:58
Show Gist options
  • Save develar/3088841 to your computer and use it in GitHub Desktop.
Save develar/3088841 to your computer and use it in GitHub Desktop.
var b3 = function (f, self) {
return function () {
return f.call(self)
}
};
var o = {};
var a = new Array(10000);
// 1
for (var i = 0; i < 10000; i++) {
a[i] = b3(function () {
this.timeoutId = -1;
}, o);
}
// 2
for (var i = 0; i < 10000; i++) {
a[i] = (function $fun() {
$fun.o.timeoutId = -1;
});
a[i].o = o;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment