Sparky saysif / else if / else branch your code based on conditions.
The core decision structure: if (cond) { … } else if (cond2) { … } else { … }. Conditions are coerced to boolean. Keep branches shallow — deeply nested ifs are a smell; prefer early returns (guard clauses) to flatten logic and make the happy path obvious.
Power-ups you unlock
if / else if / else
Conditions coerce to boolean
Guard clauses (early return) flatten nesting
Braces optional for one statement (but use them)
NaN the Trickster attacks — common mistakes
Deeply nested ifs instead of early returns
Assignment (=) instead of comparison (===) in a condition
Omitting braces and adding a second line later
Boss battleRewrite a nested if as guard clauses that return early.