Reply to Re: JavaScript: conditionally invoking functions within a function
Posted by Oli Filth on 09/30/05 16:35
Spartanicus said the following on 30/09/2005 14:15:
> How should functions be invoked conditionally from within a function?
> This throws errors and doesn't work:
>
> function test() {
> if (0 == 0)
> {
> function foo();
^
^
You don't need "function" here.
> }
> if (1 == 1)
> {
> function bar();
^
^
Nor here.
> }
> }
>