给定以下代码
(function(){console.log("ello");setTimeout("**CALL PARENT FUNCTION**",100);}())
如何每隔 X 持续时间调用此匿名父函数..
最佳答案
使用 callee
attribute在 arguments
对象上:
(function(){console.log("ello");setTimeout(arguments.callee,100);})()
然而,在 MDC 上推荐网站:
Note: You should avoid using arguments.callee() and just give every function (expression) a name.
关于javascript - JS调用自执行匿名父函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7363980/