阅读背景:

为什么在JavaScript原型中返回'this'会导致循环

来源:互联网 

So I have this super simple JS Object I was messing around with and I came across something I can't figure out. When I run this, obj.toString is called over and over until I receive a 'Maximum call stack size error'. However, if I replace 'this' in the obj.type return to 'this.name', everything works fine. I realize I wouldn't normally return just 'this', but why is it getting caught in a loop when I do?So I have this super simple JS Object I was mes




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: