3 ms·
window.setTimeout(function(c){return function() { c.doSomething(); }}(this), 1000); Mine usually look like that. Using any library to do that seems like
by axod 17y ago
window.setTimeout(function(c){return function() {
c.doSomething();
}}(this), 1000);
Mine usually look like that. Using any library to do that seems like overkill to me.
- apphacker 17y agoWell a hitch or bind function delivers more than just ability to create quick closures. It lets you define the functionality you want in a named function, allowing for code re-use and more readable code. Also I'm obviously not using the library just for bind.