How to Use an if Statement in JavaScript
Programs make decisions: show a warning when it's hot, skip a step when a file is missing. In JavaScript the if statement does that: it runs a block of code only when its condition is true, and else if and else cover the other cases.
