I have this code snippet:
switch (userInput){
case "a":
case "A":
case "ARC Gun":
case "arc gun":
var conf = confirm("Are you sure?\n Wieght: 3\nMax Ammo: 5 clips");
if (conf){
alert("The ARC Gun it is!");
wieght += 3;
break;
}else if (!conf){
}
}
Will the break statement break me out of the switch block? Or out of the if, or nothing?
Aucun commentaire:
Enregistrer un commentaire