fix: remove comments from code examples (#50254)

This commit is contained in:
Naomi Carrigan
2023-05-04 03:44:53 -07:00
committed by GitHub
parent fc0b99a6cb
commit 180e9dd1de
2 changed files with 5 additions and 9 deletions

View File

@@ -16,19 +16,15 @@ This is the basic syntax for a `switch` statement:
```js
switch (expression) {
case 1:
/*
this code will execute
if the case matches the expression
*/
console.log("1");
break;
default:
/*
the default will execute if none
of the other cases match the expression
*/
console.log("Not 1");
}
```
In this example, the first `case` checks if `expression === 1`, and if so logs `1` to the console. If no cases are true, it will log `Not 1` to the console. The `break` statement stops execution of the `switch` when the `case` is true.
Add a `switch` statement and use `e.target.value` for the expression.
# --hints--

View File

@@ -11,7 +11,7 @@ Before you can move onto the next `case`, you will need to add a `break` stateme
```js
case "example":
// code goes here
console.log("example");
break;
```