JS: Test Equality

By Xah Lee. Date: . Last updated: .

Test Equality of Primitive Values

use Triple Equal Operator === for testing Primitive Values. of the same type.

the Double Equal Operator == first do conversion if primitives are of different type.

Test Equality of Array/Object

Test Equality of NaN

To compare NaN, or distinguish negative zero and positive zero

Test Equality of Infinity

JavaScript. Test Equality

JavaScript. Boolean

JavaScript. Operators