I kind of understand closure in javascript, but I'm not sure how it handles nested functions. For example:
var a = function(o) {
o.someFunction(function(x) {
});
}
I know that a new closure is created every time I call a function a, but does this closure also make a new instance of the anonymous function passed to someFunction? It would be better if I did ff instead:
var b = function(x) { }
var a = function(o) {
o.someFunction(b);
}
source
share