如何从已声明的内部重新启动Javascript函数(node.js环境):
exports.myfunction = function(parameter){
//myfunction(); does not work
}
答案 0 :(得分:5)
exports.myfunction = function myfunction(parameter) {
// ^^^^^^^^^^
myfunction(); // does now work (but leads to a stack overflow obviously)
}
答案 1 :(得分:2)
exports.myfunction = function(parameter){
exports.myfunction(); // this works
}