问题标签 [resig]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
11 问题
0
投票
1
回答
39
浏览
javascript - 为什么 John Resig 在使用继承的 _super 后重新声明原始的 _super?
取自: https ://stackoverflow.com/a/15052240/1487102
向下滚动以查看我感兴趣的行
this._super
他在申请之前声明了继承的函数是有道理的
我不明白的是:在他执行函数并获得返回值之后,他为什么要替换
this._super
为之前的内容?
评论说只需要临时声明,但为什么不声明呢?我看不到垃圾收集将如何改进,或任何其他优化。