if...else and switch
In short: if / else if / else tests conditions in order and
runs the first one that's true, skipping the rest — any boolean
expression is fair game. switch (value) compares one value against a
list of fixed cases and jumps straight to the matching one — but it
falls through: once it starts running a case's code, it keeps going
into the next case too, unless you stop it with break. switch is
really if/else sugar for "one value, several fixed options."

Tiered shipping fees
if/else if/else handles ranges and arbitrary conditions naturally:
Each branch is tested in order, top to bottom, and the first true one
wins — 2500 > 2000 is true, so the chain stops right there and never
even looks at the other conditions. This reads naturally for ranges and
combinations that switch can't express directly.
A status code with fixed options
When you're really asking "which one of these exact values is it?",
switch is clearer:
"PACKED" and "SHIPPED" share one return by stacking two case
labels — a deliberate, controlled fall-through. default is switch's
else: it catches anything that matched no case.
The trap: forgetting break
Stack cases without a return or break, and execution keeps sliding
down into the next case's code — often by accident:
grade(95) should probably just be "A", but with no break after that
case, execution falls straight into the score >= 70 case too, giving
"A-ish". Every case needs a return or an explicit break unless
falling through is exactly what you want.
Quick practice
In if (x > 10) { ... } else if (x > 5) { ... } else { ... } with x = 20, which branch runs?
What does a switch statement do when a case has no break and no return?
What is switch best suited for, compared to if/else?
