Headshota Headshota - 1 year ago 68
Javascript Question

Call immediately executing function from outside

I've got an immediately executing function and I need to call it from outside:

(function myFunc(){
console.log("Hello from myFunc");

I'm using named function because I'm doing a recursion in it so I can reference it. but at some point recursion stops. and I need to invoke this function once again.

Answer Source

Is there a reason you have to wrap it like that? Why don't you just make a normal named function and call it:

function myFunc(){    
  console.log("Hello from myFunc");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download