--- id: 56533eb9ac21ba0edf2244d2 title: Comparison with the Inequality Operator challengeType: 1 videoUrl: '' localeTitle: 与不等式算子的比较 --- ## Description
不等运算符( != )与等于运算符相反。它意味着“不等于”并返回false ,其中相等性将返回true反之亦然 。与等式运算符一样,不等式运算符将在比较时转换数据类型的值。 例子
1!= 2 //是的
1!=“1”//假
1!='1'//假
1!= true // false
0!= false // false
## Instructions
if语句中添加不等式运算符!= ,以便当val不等于99时函数将返回“Not Equal”
## Tests
```yml tests: - text: testNotEqual(99)应返回“Equal” testString: 'assert(testNotEqual(99) === "Equal", "testNotEqual(99) should return "Equal"");' - text: testNotEqual("99")应该返回“Equal” testString: 'assert(testNotEqual("99") === "Equal", "testNotEqual("99") should return "Equal"");' - text: testNotEqual(12)应该返回“Not Equal” testString: 'assert(testNotEqual(12) === "Not Equal", "testNotEqual(12) should return "Not Equal"");' - text: testNotEqual("12")应该返回“Not Equal” testString: 'assert(testNotEqual("12") === "Not Equal", "testNotEqual("12") should return "Not Equal"");' - text: testNotEqual("bob")应返回“Not Equal” testString: 'assert(testNotEqual("bob") === "Not Equal", "testNotEqual("bob") should return "Not Equal"");' - text: 你应该使用!=运算符 testString: 'assert(code.match(/(?!!==)!=/), "You should use the != operator");' ```
## 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 // solution required ```