Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

1.6 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
56533eb9ac21ba0edf2244d3 Comparison with the Strict Inequality Operator 1 https://scrimba.com/c/cKekkUy 16791 comparison-with-the-strict-inequality-operator

--description--

The strict inequality operator (!==) is the logical opposite of the strict equality operator. It means "Strictly Not Equal" and returns false where strict equality would return true and vice versa. Strict inequality will not convert data types.

Examples

3 !==  3   // false
3 !== '3'  // true
4 !==  3   // true

--instructions--

Add the strict inequality operator to the if statement so the function will return "Not Equal" when val is not strictly equal to 17

--hints--

testStrictNotEqual(17) should return "Equal"

assert(testStrictNotEqual(17) === 'Equal');

testStrictNotEqual("17") should return "Not Equal"

assert(testStrictNotEqual('17') === 'Not Equal');

testStrictNotEqual(12) should return "Not Equal"

assert(testStrictNotEqual(12) === 'Not Equal');

testStrictNotEqual("bob") should return "Not Equal"

assert(testStrictNotEqual('bob') === 'Not Equal');

You should use the !== operator

assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0);

--seed--

--seed-contents--

// Setup
function testStrictNotEqual(val) {
  if (val) { // Change this line
    return "Not Equal";
  }
  return "Equal";
}

testStrictNotEqual(10);

--solutions--

function testStrictNotEqual(val) {
  if (val !== 17) {
    return "Not Equal";
  }
  return "Equal";
}