Die Switch-Anweisung...

...als Ersatz für mehrfach verschachtelte if-else-Anweisungen

var x = 0
switch (x/Math.abs(x))
{
   case -1 :
       document.writeln("x ist negativ");
       break;
   case 1 :
       document.writeln("x ist positiv");
       break;
   default :
       document.writeln("x ist Null");
}