← JavaScript learning pathJavaScript · Module 3 of 10
Operators and conditions
Compare values safely and choose paths with if, else and the ternary operator.
📖 Key ideas
- === compares value and type; == converts types first (avoid it).
- Logical operators: && (and), || (or), ! (not).
- if / else if / else choose what runs.
- Ternary: condition ? a : b.
- Falsy values: false, 0, "", null, undefined, NaN.
💡 Real-life example: Strict === is a bank teller checking both the name and the photo; == only checks the name.
===Strict equality: value and type
&&Logical AND
Ternarycondition ? a : b
FalsyValue treated as false