DEV Community

Double Equals vs Triple Equals in JavaScript

Raúl Sánchez on March 22, 2019

Unlike other languages JavaScript has two ways to determine equalities. It can be rather confusing for people like myself who come from typed langu...
Collapse
 
uddeshjain profile image
Uddesh

Good explanation.
But triple equals mainly checks the equality between objects like left side and right side both are referring to the same object or not.
For example,

var a = {}
var b = {}
console.log(a === b) //False

Above code will return FALSE because both variable not referring to same object. Let's consider another example.

var a = {}
var b = a
console.log(a === b) // True

The above code will return TRUE because both left and right side referring to same object.