Why is the value of this tag 1 and this tag 2 different when the second callback is made by the two calls
?
function a (val, callback) {
callback.call(a,val,callback)
}
a(1,function b (val ,callback) {
console.log(this, "1")
console.log(val)
console.log(callback)
callback(2,function c(val, callback){
console.log(this)
console.log(val)
console.log(callback)
console.log("over")
})
})
console.log("------------")
a(1,function b () {
console.log(this, "2")
console.log(arguments[0])
console.log(arguments[1])
arguments[1](2,function c(){
console.log(this)
console.log(arguments[0])
console.log(arguments[1])
console.log("over")
})
})