!== 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
Contact Us