I asked a question about callbacks and arrived at another question (see comment). How is a closure different from a callback?
closure :
A function keyword inside another function, you are creating a closure
Or A function return to an other function we can say closure
Note Plain English : A little bit difference function passing as argument in another function is callback or if define in another function is closure
var length = 101;
function fn2() {
console.log("fffxxx: "+this.length);
}
var obj = {
length: 5,
method3: function(fn) {
fn();
arguments[0]();
}
};
obj.method3(fn2, 1);
fffxxx:101
fffxxx:2**