(前端)面试300问之(3)this的指向判断(JavaScript)
一、this的相关理解与解读
1、各角度看this。
1)ECMAScript规范:
this 关键字执行为当前执行环境的 ThisBinding。
2)MDN:
In most cases, the value of this is determined by how a function is called.
在绝大多数情况下,函数的调用方式决定了this的值。
3)其实,没必要记这些文邹邹的句子去理解【哎,很多我们懂的词语放在同一个句子里,我们可能就读不懂其意思了】。
我们只需记住一个魔法口诀 ——
原创
2021-04-04 16:26:33 ·
167 阅读 ·
0 评论