Hallo bleicher,
du meinst so?
( [ function() { alert("a"); }, function() { alert("b"); } ][Math.floor(Math.random()*2)] )();
Das ist ein anonymes Array anonymer Funktionen, von denen eine sofort zufallsgesteuert ausgeführt wird.
Gruß, Jürgen
Hallo bleicher,
du meinst so?
( [ function() { alert("a"); }, function() { alert("b"); } ][Math.floor(Math.random()*2)] )();
Das ist ein anonymes Array anonymer Funktionen, von denen eine sofort zufallsgesteuert ausgeführt wird.
Gruß, Jürgen