JavaScript === Strict equality Operator
The strict equality operator (===) checks whether two values are equal without converting their types. It is the recommended way to compare values in JavaScript.
Description
The strict equality operator === checks whether two operands are equal and returns a boolean. Unlike the loose equality operator ==, it never converts types: values of different types are always unequal, so 1 === '1' is false.
Objects, including arrays and functions, are compared by reference: two separate objects with identical contents are not equal, but two references to the same object are. Two special cases: NaN === NaN is false, and +0 === -0 is true. Use Number.isNaN() or Object.is() when those matter.
Because it has no hidden type conversion, === (and its opposite, !==) is the comparison most style guides recommend.
Properties
- Operator
===- Category
- Comparison
- Precedence
- 8 (1 is lowest, 18 is highest)
- Associativity
- left-to-right
Syntax
x === yExample
Browser Support
The following information will show you the current browser support for the === operator. Hover over a browser icon to see the version that first introduced support for this operator.
Desktop





Tablets & Mobile





