2018-09-30 23:01:58 +01:00
---
id: 56533eb9ac21ba0edf2244d3
title: Comparison with the Strict Inequality Operator
challengeType: 1
2019-02-14 12:24:02 -05:00
videoUrl: 'https://scrimba.com/c/cKekkUy'
2019-07-31 11:32:23 -07:00
forumTopicId: 16791
2021-01-13 03:31:00 +01:00
dashedName: comparison-with-the-strict-inequality-operator
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
The strict inequality operator (`!==` ) 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**
2019-05-17 06:20:30 -07:00
```js
3 !== 3 // false
3 !== '3' // true
4 !== 3 // true
```
2020-11-27 19:02:05 +01:00
# --instructions--
Add the strict inequality operator to the `if` statement so the function will return "Not Equal" when `val` is not strictly equal to `17`
# --hints--
`testStrictNotEqual(17)` should return "Equal"
```js
assert(testStrictNotEqual(17) === 'Equal');
```
`testStrictNotEqual("17")` should return "Not Equal"
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
assert(testStrictNotEqual('17') === 'Not Equal');
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
`testStrictNotEqual(12)` should return "Not Equal"
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
assert(testStrictNotEqual(12) === 'Not Equal');
```
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
`testStrictNotEqual("bob")` should return "Not Equal"
```js
assert(testStrictNotEqual('bob') === 'Not Equal');
```
You should use the `!==` operator
```js
assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0);
```
# --seed--
## --seed-contents--
2018-09-30 23:01:58 +01:00
```js
// Setup
function testStrictNotEqual(val) {
2019-02-27 01:38:46 +04:00
if (val) { // Change this line
2018-09-30 23:01:58 +01:00
return "Not Equal";
}
return "Equal";
}
testStrictNotEqual(10);
```
2020-11-27 19:02:05 +01:00
# --solutions--
2018-09-30 23:01:58 +01:00
```js
function testStrictNotEqual(val) {
if (val !== 17) {
return "Not Equal";
}
return "Equal";
}
```