Strict vs Loose Equality
Multiple Choice Beginner
Question
What is the key difference between == and === in JavaScript?
Hint
Think about what happens when comparing 0 == "0".
Explanation
The === operator checks both value and type without coercion, so 0 === "0" is false. The == operator performs type coercion before comparing, so 0 == "0" is true. Always prefer === to avoid surprising coercion bugs.
Related Resources
Related Lessons
- Conditions (if/else)
Learn how if/else conditions work.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.