0

So i have this snippet, which obviously doesn't work, but it demonstrates what I want:

function myFunction1 (){doStuff();}
var x = 1;
myFunctionx();

Is there a way to make this work? Of cause i could do something like this:

function myFunction1 (){doStuff();}
var x = 1;
function call (){
 if (x=1){myFunction1();}
 if (x=2){myFunction2();}
}

But this gets really nasty really fast. Any help?

koljaa
  • 28
  • 5

0 Answers0