Merge pull request #1877 from janina213/patch-1

add break to switch case example
This commit is contained in:
Ilya Kantor 2020-04-29 11:13:01 +03:00 committed by GitHub
commit f2a099bd0b
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) {
case 18:
alert("Won't work"); // the result of prompt is a string, not a number
break;
case "18":
alert("This works!");