how do I restart a Javascript function (node.js environment) from inside that has been declared like this:
如何从已声明如下的内部重新启动Javascript函数(node.js环境):
exports.myfunction = function(parameter){
//myfunction(); does not work
}
2 个解决方案
#1
4
exports.myfunction = function myfunction(parameter) {
// ^^^^^^^^^^
myfunction(); // does now work (but leads to a stack overflow obviously)
}
#2
1
exports.myfunction = function(parameter){
exports.myfunction(); // this works
}
#1
4
exports.myfunction = function myfunction(parameter) {
// ^^^^^^^^^^
myfunction(); // does now work (but leads to a stack overflow obviously)
}
#2
1
exports.myfunction = function(parameter){
exports.myfunction(); // this works
}