Favorites

JavaScript !== Strict inequality 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 inequality operator (!==) checks whether two values are different, without converting their types.

Description

The strict inequality operator !== returns true if the operands are of different types or have different values. It's the negation of === and the recommended way to test that two values differ.

It follows the same rules as ===: values of different types are always unequal, objects are compared by reference, and NaN !== NaN is true because NaN isn't equal to anything. To check whether a value is NaN, use Number.isNaN() instead.

!== is the inequality most style guides recommend, because there are no hidden conversions. It's commonly used to check that a search found something, such as arr.indexOf(x) !== -1, although includes() now says that more directly.

Properties

Operator
!==
Category
Comparison
Precedence
8 (1 is lowest, 18 is highest)
Associativity
left-to-right

Syntax

x !== y

Example

console.log(5 !== '5');
console.log('a' !== 'a');
const items = [];
if (items.length !== 0) console.log('has items'); else console.log('empty');

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