JAVASCRIPT CLIMBSChapter 2 · JS Conditionals & Logic
Else If Chains
Check multiple conditions using else if blocks. JavaScript runs the first block where the condition evaluates to true and skips the rest.
Worked example
How it reads
- else if (hour < 18) runs only if the preceding if statement was false
- The final else runs if no conditions were met

Cloud tip: You can insert as many else if blocks as necessary between the initial if and the final else.


