JavaScript: Test Equality
Double Equal Operator
The double equal operator ==
is for testing equality of primitives of the same Type. If operands are of different type, a type conversion is done first.
Tip: never use double equal.
Triple Equal Operator
Test Equality of Array/Object
Test Equality of NaN
To compare NaN, use: