Double vs Triple equals in JavaScript

Using the triple equals, the values must be equal in type as well. Therefore, it’s always suggested to use === since that is a more thorough check and helps in avoiding bugs at a later stage. Happy Learning & Coding 🙂

Sample Code Snippet:-

1 == “1” // true
1 === “1” // false

1 != "1" // false
1 !== "1" // true

0 == false // true
0 === false // false

null == undefined // true
null === undefined // false

Leave a comment