JavaScript !== Strict inequality Operator
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 !== 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





