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 Reply

Your email address will not be published. Required fields are marked *