作用域 + this指向 的一道没面试题

 

 

输出?

let aname = 'zzh'
let obj = {
    aname: 'lyy',
    say() {
        console.log(this.aname)
        return function () {
            console.log(this.aname)
            console.log(aname)
        }
    }
}
obj.say()()

 

posted @ 2021-04-06 14:14  javascript9527  阅读(28)  评论(0编辑  收藏  举报