PRO
Jacob
asked

Expert
Abhay Jajodia answered
Hi Jacob,
== compares values after JavaScript may convert one type to another (type coercion).=== compares both the value and the type, with no conversion.
Example:
5 == "5" // true (string "5" is converted to number)
5 === "5" // false (number vs string)
Most of the time, === is safer because it avoids surprising conversions.
If you have more questions, I am here to help π
JS
This question was asked as part of the Learn JavaScript Basics course.








