!==
) is the logical opposite of the strict equality operator. It means "Strictly Not Equal" and returns false
where strict equality would return true
and vice versa. Strict inequality will not convert data types.
Examples
```js
3 !== 3 // false
3 !== '3' // true
4 !== 3 // true
```
if
statement so the function will return "Not Equal" when val
is not strictly equal to 17
testStrictNotEqual(17)
should return "Equal"
testString: assert(testStrictNotEqual(17) === "Equal");
- text: testStrictNotEqual("17")
should return "Not Equal"
testString: assert(testStrictNotEqual("17") === "Not Equal");
- text: testStrictNotEqual(12)
should return "Not Equal"
testString: assert(testStrictNotEqual(12) === "Not Equal");
- text: testStrictNotEqual("bob")
should return "Not Equal"
testString: assert(testStrictNotEqual("bob") === "Not Equal");
- text: You should use the !==
operator
testString: assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0);
```