# JavaScript Overview – switch Statement

Within JavaScript, switch statements are similar to C, but are also able to use strings, as well:

     switch (name) {
      case "Fred":
        processFredReport();
        break;
      case "Sam":
      case "Samantha":
        processSamReport();
        break;
      case 911:	// also matches "911"
        emergencyAlert();
    		// Fall through (discouraged)
      default:
        return "Unable to process report!";
    }