What is the difference between == and === in JavaScript? This is one of the most frequently asked questions in interviews when someone tries to judge your jQuery or JavaScript concepts.
JavaScript provides different types of operators. Here, we will be talking about strict equality and Type converting equality.
Strict equality (===) means values which we are comparing must have the same type.
This means “2” will not be equal to 2 (“2”===2 it will return false)
Type converting equality (==) means automatically it will covert the variable to value irrespective of data type; either it is a string or a number. This means “2” will be equal to 2 (“2” == 2 it will return true).
So the double equal (==) is an auto type converting equality and three equals (===) is a strict equality operator, i.e., it will not covert values automatically.
#javascript #jquery