Skip to content

Commit 3e044c8

Browse files
committed
exec: what-is-the-purpose-of-the-switch-statement
1 parent 52b9eb3 commit 3e044c8

File tree

1 file changed

+2
-2
lines changed
  • questions/what-is-the-purpose-of-the-switch-statement

1 file changed

+2
-2
lines changed

questions/what-is-the-purpose-of-the-switch-statement/en-US.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ switch (expression) {
5757

5858
Here is an example of a `switch` statement in action:
5959

60-
```js
60+
```js live
6161
let fruit = 'apple';
6262

6363
switch (fruit) {
@@ -81,7 +81,7 @@ In this example, the output will be `Apple is red.` because the value of `fruit`
8181

8282
If the `break` statement is omitted, the `switch` statement will continue to execute the subsequent `case` blocks until it encounters a `break` or the end of the `switch` block. This is known as fall-through behavior.
8383

84-
```js
84+
```js live
8585
let day = 2;
8686

8787
switch (day) {

0 commit comments

Comments
 (0)