his指向哪里?
一般而言,在Javascript中,this指向函数执行时的当前对象。
In JavaScript, as in most object-oriented programming languages,
this
is a special keyword that is used within methods to refer to the object on which a method is being invoked.
值得注意,该关键字在Javascript中和执行环境,而非声明环境有关。
The this keyword is relative to the execution context, not the declaration context.
可参考下面这个文章
http://www.cnblogs.com/justany/archive/2012/11/01/the_keyword_this_in_javascript.html
时间: 2024-10-05 20:47:08