fix(curriculum): Add break and default to switch review (#58305)

Co-authored-by: Sem Bauke <sem@freecodecamp.org>
This commit is contained in:
c0d1ng_ma5ter 2025-01-23 13:19:57 -06:00 committed by GitHub
parent f3b09f0e8a
commit de3a6eb4dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,7 +28,7 @@ console.log(null === undefined); // false
## `switch` Statements
- **Definition**: A `switch` statement evaluates an expression and matches its value against a series of `case` clauses. When a match is found, the code block associated with that case is executed.
- **Definition**: A `switch` statement evaluates an expression and matches its value against a series of `case` clauses. When a match is found, the code block associated with that case is executed. A `break` statement should be placed at the end of each case, to terminate its execution and continue with the next. The `default` case is an optional case and only executes if none of the other cases match. The `default` case is placed at the end of a `switch` statement.
```js
const dayOfWeek = 3;