add break to number case
This commit is contained in:
parent
d65141d44b
commit
ec9ae12900
1 changed files with 1 additions and 0 deletions
|
@ -213,6 +213,7 @@ let age = prompt('Your age?', 18);
|
||||||
switch (age) {
|
switch (age) {
|
||||||
case 18:
|
case 18:
|
||||||
alert("Won't work"); // the result of prompt is a string, not a number
|
alert("Won't work"); // the result of prompt is a string, not a number
|
||||||
|
break;
|
||||||
|
|
||||||
case "18":
|
case "18":
|
||||||
alert("This works!");
|
alert("This works!");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue