下面这两种情况,普通函数中的this
到底指代什么?
//1.
function xxx() {
console.log(this)
}
xxx() //输出:undefined
//2.
function aaa() {
return this
}
aaa() //输出:Windows{...}
下面这两种情况,普通函数中的this
到底指代什么?
//1.
function xxx() {
console.log(this)
}
xxx() //输出:undefined
//2.
function aaa() {
return this
}
aaa() //输出:Windows{...}