Possible Duplicate:
Javascript === vs == : Does it matter which “equal” operator I use?
Difference between == and === in JavaScript
I have two variables to compare.
Result should not be equal, in which condition i need to use != and !== ?
because when i use both operator it is working properly, but i need to know exactly what is the difference.
Human readable text about their differences
Using
!==and===will do a more strict compare than==/!=. The former will check if the objects being compared are of the same type, as well as if the values matches.Using
==will make it possible for an implicit cast to be made, see the below examples.What does the standard say?