2018-09-30 23:01:58 +01:00
---
id: 56533eb9ac21ba0edf2244d2
title: Comparison with the Inequality Operator
challengeType: 1
2019-02-14 12:24:02 -05:00
videoUrl: 'https://scrimba.com/c/cdBm9Sr'
2019-07-31 11:32:23 -07:00
forumTopicId: 16787
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
The inequality operator (`!=` ) is the opposite of the equality operator. It means "Not Equal" and returns `false` where equality would return `true` and *vice versa* . Like the equality operator, the inequality operator will convert data types of values while comparing.
**Examples**
2019-05-17 06:20:30 -07:00
```js
1 != 2 // true
1 != "1" // false
1 != '1' // false
1 != true // false
0 != false // false
```
2020-11-27 19:02:05 +01:00
# --instructions--
Add the inequality operator `!=` in the `if` statement so that the function will return "Not Equal" when `val` is not equivalent to `99`
# --hints--
`testNotEqual(99)` should return "Equal"
```js
assert(testNotEqual(99) === 'Equal');
```
`testNotEqual("99")` should return "Equal"
```js
assert(testNotEqual('99') === 'Equal');
```
`testNotEqual(12)` should return "Not Equal"
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
assert(testNotEqual(12) === 'Not Equal');
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
`testNotEqual("12")` should return "Not Equal"
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
assert(testNotEqual('12') === 'Not Equal');
```
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
`testNotEqual("bob")` should return "Not Equal"
```js
assert(testNotEqual('bob') === 'Not Equal');
```
You should use the `!=` operator
```js
assert(code.match(/(?!!==)!=/));
```
# --seed--
## --seed-contents--
2018-09-30 23:01:58 +01:00
```js
// Setup
function testNotEqual(val) {
if (val) { // Change this line
return "Not Equal";
}
return "Equal";
}
testNotEqual(10);
```
2020-11-27 19:02:05 +01:00
# --solutions--
2018-09-30 23:01:58 +01:00
```js
function testNotEqual(val) {
if (val != 99) {
return "Not Equal";
}
return "Equal";
}
```