I have something similar to the code below:
var msg="first call";
(function test(msg)
{
console.log("inside self call");
}
)();
msg="second call";
console.log("before inline call");
test(msg);
console.log("after inline call");
Where I need to call a function (that is self-invoked at the beginning of the code).
It seems to me that I can not call a self-invoked function. But I am not sure as this is the first time I face such situation. This is the output I'm getting in the console:
inside self call
before inline call
ReferenceError: test is not defined
Is there a way other than repeating the function code with another name?