mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-24 11:03:17 -04:00
fix: remove comments from code examples (#50254)
This commit is contained in:
@@ -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--
|
||||
|
||||
@@ -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;
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user