As said here:
http://jqfundamentals.com/book/index.html
Closures can also be used to resolve issues with the this keyword, which is unique t
What it's referring to are things like this
obj.doSomething = function() {
var that = this;
setTimeout(function() {
// this is the window
// that is the obj
that.doSomethingElse();
}, 50);
};
vs
obj.doSomething = function() {
setTimeout((function() {
// this is the obj
this.doSomethingElse();
}).bind(this), 50);
};
Benchmark. No noticable difference in chrome.