--- id: 56533eb9ac21ba0edf2244d2 title: Comparison with the Inequality Operator challengeType: 1 videoUrl: 'https://scrimba.com/c/cdBm9Sr' forumTopicId: 16787 --- ## 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 ```js 1 != 2 // true 1 != "1" // false 1 != '1' // false 1 != true // false 0 != false // false ```
## Instructions
Add the inequality operator != in the if statement so that the function will return "Not Equal" when val is not equivalent to 99
## Tests
```yml tests: - text: testNotEqual(99) should return "Equal" testString: assert(testNotEqual(99) === "Equal"); - text: testNotEqual("99") should return "Equal" testString: assert(testNotEqual("99") === "Equal"); - text: testNotEqual(12) should return "Not Equal" testString: assert(testNotEqual(12) === "Not Equal"); - text: testNotEqual("12") should return "Not Equal" testString: assert(testNotEqual("12") === "Not Equal"); - text: testNotEqual("bob") should return "Not Equal" testString: assert(testNotEqual("bob") === "Not Equal"); - text: You should use the != operator testString: assert(code.match(/(?!!==)!=/)); ```
## Challenge Seed
```js // Setup function testNotEqual(val) { if (val) { // Change this line return "Not Equal"; } return "Equal"; } // Change this value to test testNotEqual(10); ```
## Solution
```js function testNotEqual(val) { if (val != 99) { return "Not Equal"; } return "Equal"; } ```