I'm making a simple switch function:
var game = prompt("What game do you want to play?");
switch(game) {
case 'League of Legends':
console.log("You just played that!");
//more case statements snipped... //
break;
}
If the user puts league of legends, not League of Legends would it catch that or would it reset to the default answer at the bottom of all my cases? Furthermore, how would I change it so both answers, capitalized and not, worked?
.toLowerCase()everything as a first cut?