JavaScript: Test Equality

By Xah Lee. Date: . Last updated: .

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.

[see Double Equal Operator]

Triple Equal Operator

Test Equality of Array/Object

Test Equality of NaN

To compare NaN, use:

Test Equality of Infinity

JavaScript Boolean

JavaScript Operators

BUY
Ξ£JS
JavaScript in Depth

JavaScript in Depth

Basic Syntax

Value Types

Variable

String

Property

Object and Inheritance

Array

Function

Constructor/Class

Iterable 🌟

Misc