javascript switch


var inspect_me = 0,

  result = '';

switch (inspect_me) {

  case 0:

    result = 'zero';

    break;

  case 1:

  case '1':

    result = 'one';

    break;

  default:

    result = 'unknown';

}

Leave a Comment