作用域 + this指向 的一道没面试题
输出?
let aname = 'zzh'
let obj = {
aname: 'lyy',
say() {
console.log(this.aname)
return function () {
console.log(this.aname)
console.log(aname)
}
}
}
obj.say()()
输出?
let aname = 'zzh'
let obj = {
aname: 'lyy',
say() {
console.log(this.aname)
return function () {
console.log(this.aname)
console.log(aname)
}
}
}
obj.say()()