Utilizor
Contact Us

== vs ===

Loose vs Strict equality.

== vs ===

== checks for equality of value (loose equality). It performs type conversion if necessary.

=== checks for equality of value and type (strict equality). It does not perform type conversion.

5 == "5" // true 5 === "5" // false

It is generally recommended to use === to avoid unexpected type coercion results.

Example

let x = 5;
x === "5"; // false