如果 arguments.callee 在“use strict”中不被允许,我们不能这样做
var f = function g() {
//g
}
因为在 IE 中这行不通(或者会“奇怪地”工作)http://kangax.github.com/nfe/#jscript-bugs ,那么我们还有哪些其他选项可以在函数本身中引用匿名函数?
最佳答案
这正是 Y combinator 是什么是为了。
Here's an article by James Coglan about deriving the Y combinator in JavaScript.
关于javascript:如何在函数本身中引用匿名函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5757476/