What is Object Equality in Javascript? In javascript there are TWO purpose of Object Equality in Javascript. (1)In first we used "==" to compare two variables with USING its data type. Just like below will return true if we compare:- "2"==2 Here we will not CHECK its type but only the values. (2)In second we used "===" to compare both DATATYPE and values. Here below will return FALSE:- "2"==2 Here above will return false as one is string type and other is int type.