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
2018-09-30 23:01:58 +01:00
---
## Description
< section id = 'description' >
The strict inequality operator (< code > !==< / code > ) is the logical opposite of the strict equality operator. It means "Strictly Not Equal" and returns < code > false< / code > where strict equality would return < code > true< / code > and < em > vice versa< / em > . Strict inequality will not convert data types.
< strong > Examples< / strong >
2019-05-17 06:20:30 -07:00
```js
3 !== 3 // false
3 !== '3' // true
4 !== 3 // true
```
2018-09-30 23:01:58 +01:00
< / section >
## Instructions
< section id = 'instructions' >
2019-10-27 15:45:37 -01:00
Add the strict inequality operator to the < code > if< / code > statement so the function will return "Not Equal" when < code > val< / code > is not strictly equal to < code > 17< / code >
2018-09-30 23:01:58 +01:00
< / section >
## Tests
< section id = 'tests' >
```yml
2018-10-04 14:37:37 +01:00
tests:
- text: < code > testStrictNotEqual(17)</ code > should return "Equal"
2019-07-13 00:07:53 -07:00
testString: assert(testStrictNotEqual(17) === "Equal");
2018-10-04 14:37:37 +01:00
- text: < code > testStrictNotEqual("17")</ code > should return "Not Equal"
2019-07-13 00:07:53 -07:00
testString: assert(testStrictNotEqual("17") === "Not Equal");
2018-10-04 14:37:37 +01:00
- text: < code > testStrictNotEqual(12)</ code > should return "Not Equal"
2019-07-13 00:07:53 -07:00
testString: assert(testStrictNotEqual(12) === "Not Equal");
2018-10-04 14:37:37 +01:00
- text: < code > testStrictNotEqual("bob")</ code > should return "Not Equal"
2019-07-13 00:07:53 -07:00
testString: assert(testStrictNotEqual("bob") === "Not Equal");
2018-10-04 14:37:37 +01:00
- text: You should use the < code > !==</ code > operator
2019-07-13 00:07:53 -07:00
testString: assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0);
2018-09-30 23:01:58 +01:00
```
< / section >
## Challenge Seed
< section id = 'challengeSeed' >
< div id = 'js-seed' >
```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);
```
< / div >
< / section >
## Solution
< section id = 'solution' >
```js
function testStrictNotEqual(val) {
if (val !== 17) {
return "Not Equal";
}
return "Equal";
}
```
< / section >