Favorites

JavaScript === Strict equality Operator

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
===
JavaScript Comparison OperatorThis operator is supported by all modern browsers.
Updated 28th November 2026

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 === y

Example

console.log(1 === 1);
console.log(1 === '1');     // different types
console.log(1 == '1');      // loose equality converts

const a = [1, 2];
const b = [1, 2];
console.log(a === b);       // different objects
console.log(a === a);

console.log(NaN === NaN);
console.log(Object.is(NaN, NaN));

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.

This operator is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee