[英]this refers to inside function on javascript
var a = function foo(){
this.confusing = 'hell yeah';
function boo(){
this...
}
}
In function boo()
which call inside of foo()
, will this
be defined for foo()
element? 在
foo()
内部调用的boo()
函数中,是否将为foo()
元素定义this
函数?
Inside the boo
function, this
will reference the boo
function object, or "window" if you will. 里面的
boo
功能, this
将参考boo
,如果你愿意函数对象,或“窗口”。 This is similar to the stacking of scopes in python, if you're familiar with that. 如果您熟悉,这类似于python中作用域的堆叠。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.