如何理解js中this指向:由执行上下文决定/在执行时确定?
对于this指向的解释,在MDN(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this)中有这么一句话,In most cases, the value of this is determined by how a function is called (runtime binding).大概意思是说,this的值是由这个函数如何被调用来决定的。我把它理解为:函数定义的时候,this的指向
原创
2020-10-23 12:02:52 ·
853 阅读 ·
0 评论