function somefunction(cb) {
for(var i=0; i<100000; i++){
}
cb.call({});
};
var a=10;
function test(params) {
somefunction(function () {
console.log(this.a);
});
somefunction(()=>{
console.log(this.a);
});
};
test();
output of the above code is undefined & 10
I am curious to know when does context binding happened for the arrow function when it printed 10 in the second somefunction
call even though i specified different context through bind.