!== operator

The strict inequality operator (!==) is the logical opposite of the strict equality operator. It means “Strictly Not Equal” and returns true whereas strict equality would return false and vice versa.

Strict inequality will not convert data types.

For example 1 !== ‘1’ will return true since 1 is an integer and ‘1’ is a character and no data type conversion takes place.

Example: Below example shows !== Operator.

Javascript




console.log(" 1 !== '1' " + (1 !== '1'));
console.log(" 1 !== 1 " + (1 !== 1));
console.log(" 1 !== '2' " + (1 !== '2'));


Output

 1 !== '1' true
 1 !== 1 false
 1 !== '2' true

Difference between != and !== operator in JavaScript

Similar Reads

!= operator

The inequality operator (!=) is the logical opposite of the equality operator. It means “Not Equal” and returns true whereas equality would return false and vice versa. Like the equality operator, the inequality operator will convert data types of values while comparing....

!== operator

...

Difference between != and !== operator in JavaScript

The strict inequality operator (!==) is the logical opposite of the strict equality operator. It means “Strictly Not Equal” and returns true whereas strict equality would return false and vice versa....