Take a look at this example:
function aaa () {
console.dir(this)
}
function bbb () {}
aaa.apply(undefined, [1,2,3]) // this in aaa is `window` object
aaa.apply(bbb, [1,2,3]) // this in aaa is `bbb` function
Why is this
set to window
in first apply case, even though I'm trying to force it to be undefined
?