# Making Decisions with if and else

An if statement runs a block of code only when its condition is true, else gives the other path, and else if chooses between several, so your program can react to what's going on.

![Cheat sheet: Making Decisions with if and else](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/10/6f18fa1bdcc24261be884bfcf81f3ac6.webp)

- Category: JavaScript
- Level: Novice
- Tags: Code Block (general), else Statement, if Statement (javascript), JavaScript
- Updated: November 1, 2026

Source: https://www.ask-codey.com/cheat-sheets/javascript-conditions-if-and-else-cheat-sheet
