A
Adam Lipscombe
Folks
If a function accepts another function as an parameter like this:
function myFunc(func)
{
alert("func = " + func);
}
The alert print the entire function definition.
Is there any way to easily extract just the function name from the func argument?
e.g. "func = function1" instead of "func = function function1() {.....}"
I know one could use string slicing but I wondered if there was a canonical solution?
Thanks - Adam
If a function accepts another function as an parameter like this:
function myFunc(func)
{
alert("func = " + func);
}
The alert print the entire function definition.
Is there any way to easily extract just the function name from the func argument?
e.g. "func = function1" instead of "func = function function1() {.....}"
I know one could use string slicing but I wondered if there was a canonical solution?
Thanks - Adam