I
info
Hi...
I want to know (inside a function) if the calling code wants a return
value or not.
Here is an example:
function foo()
{
alert(return_wanted()); // "return_wanted" is just a name of the
function I search...
}
x=foo();
foo();
which should give "true" in the first case and "false" in the second.
An according function in perl is called "wantarray", which gives
"undef" if no return value is wanted.
Is there anything like this in javascript?
Thanks for any help in advance,
Christoph Bergmann
I want to know (inside a function) if the calling code wants a return
value or not.
Here is an example:
function foo()
{
alert(return_wanted()); // "return_wanted" is just a name of the
function I search...
}
x=foo();
foo();
which should give "true" in the first case and "false" in the second.
An according function in perl is called "wantarray", which gives
"undef" if no return value is wanted.
Is there anything like this in javascript?
Thanks for any help in advance,
Christoph Bergmann