Every if statement evaluates a boolean expression. When the expression is true, the block executes. When false, it skips to the else branch (if present) or continues after.
Complex conditions combine multiple boolean expressions. You've seen if (age >= 18 && hasID). Both parts must be true for the block to run.
Ternary operators also use boolean expressions: result = (x > 0) ? 1 : -1. If x > 0 is true, assign 1. Otherwise, assign -1.