Skip to content

Commit 0dff7c5

Browse files
Clarify else-if evaluation order (mdn#43917)
1 parent c53bfa0 commit 0dff7c5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • files/en-us/web/javascript/reference/statements/if...else

files/en-us/web/javascript/reference/statements/if...else/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ else
7575
// …
7676
```
7777

78+
The conditions are evaluated in order until one evaluates to `true`. At that point, the associated statement is executed and the rest of the `else if` clauses are skipped.
79+
7880
To execute multiple statements within a clause, use a block statement (`{ /* ... */ }`) to group those statements.
7981

8082
```js-nolint

0 commit comments

Comments
 (0)