The if statement runs code only when a condition is true:
let age = 20
if (age >= 18) {
console.log("You can vote")
}
The condition goes in parentheses. The code to run goes in curly braces. If the condition is false, the code block is skipped entirely. This is the foundation of all decision-making in programs.