i am trying to understand different aspects of closure.Here i have created a nested closure of function returning functions.I called the first function which this is bound to another object called "obj".First outpup is set to current object "obj".But the inner function's "THIS" is set to original "WINDOW" object.Why the are not pointing to "obj" variable.Because first "THIS" is set to "obj".Other "THIS" should be set to "obj" too,shouldn't it ?
function one(){
console.log(this);
return function(){
console.log(this);
return function(){
console.log(this);
}
}
}
var obj={};
one.call(obj)()();
output is :
obj
window
window