Strict vs Loose Equality
Concept Check Medium
Question
Which statement about `==` and `===` is correct?
Hint
=== is the strict equality operator.
Explanation
=== (strict equality) compares both value and type without any type coercion — 5 === "5" is false. == (loose equality) coerces operands to the same type before comparing — 5 == "5" is true. Best practice is to always use === to avoid unexpected coercion bugs.
Related Resources
Related Lessons
- JavaScript Data Types
Learn about equality operators.
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.