* fix: Chinese test suite Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working. * fix: ran script, updated testStrings and solutions
2.0 KiB
2.0 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
56533eb9ac21ba0edf2244d3 | Comparison with the Strict Inequality Operator | 1 | 与严格不等式算子的比较 |
Description
!==
)与严格相等运算符的逻辑相反。它意味着“严格不等于”并返回false
,其中严格相等将返回true
, 反之亦然 。严格的不等式不会转换数据类型。 例子 3!== 3 //假
3!=='3'//是的
4!== 3 //是的
Instructions
strict inequality operator
添加到if
语句,以便当val
不严格等于17
时,函数将返回“Not Equal” Tests
tests:
- text: <code>testStrictNotEqual(17)</code>应返回“Equal”
testString: assert(testStrictNotEqual(17) === "Equal");
- text: <code>testStrictNotEqual("17")</code>应返回“Not Equal”
testString: assert(testStrictNotEqual("17") === "Not Equal");
- text: <code>testStrictNotEqual(12)</code>应该返回“Not Equal”
testString: assert(testStrictNotEqual(12) === "Not Equal");
- text: <code>testStrictNotEqual("bob")</code>应返回“Not Equal”
testString: assert(testStrictNotEqual("bob") === "Not Equal");
- text: 你应该使用<code>!==</code>运算符
testString: assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0);
Challenge Seed
// Setup
function testStrictNotEqual(val) {
// Only Change Code Below this Line
if (val) {
// Only Change Code Above this Line
return "Not Equal";
}
return "Equal";
}
// Change this value to test
testStrictNotEqual(10);
Solution
// solution required