JavaScript

What is the difference between == and ===?

Easy
4
Added
== performs type coercion, === checks value and type without coercion.

Solution Code

JavaScript
console.log('5' == 5); // true
console.log('5' === 5); // false
Explanation
Always use === unless explicitly wanting type coercion.

Guided Hints

List falsy values
Strange coercion examples