We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
this跟代码中的位置没有关系,是在执行时赋值的。也就是说this只存在于函数调用(运行)期间,在变量作用域中不存在
分析this时,不能看代码位置来确定,要看怎么调用的
this是在函数运行期赋值的,这步由JavaScript引擎来做,if(!this && !strictFlag) { this = window}
if(!this && !strictFlag) { this = window}
this是不会沿着变量作用域、原型链或闭包结构向上查找的