add break to number case

This commit is contained in:
Janina 2020-04-28 18:06:12 -07:00 committed by GitHub
parent d65141d44b
commit ec9ae12900
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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!");