Oliver Eyton-Williams bd68b70f3d
Feat: hide blocks not challenges (#39504)
* fix: remove isHidden flag from frontmatter

* fix: add isUpcomingChange

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

* feat: hide blocks not challenges

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2020-09-03 15:07:40 -07:00

2.0 KiB

id, title, challengeType, videoUrl, forumTopicId
id title challengeType videoUrl forumTopicId
56533eb9ac21ba0edf2244d2 Comparison with the Inequality Operator 1 https://scrimba.com/c/cdBm9Sr 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
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

tests:
  - text: <code>testNotEqual(99)</code> should return "Equal"
    testString: assert(testNotEqual(99) === "Equal");
  - text: <code>testNotEqual("99")</code> should return "Equal"
    testString: assert(testNotEqual("99") === "Equal");
  - text: <code>testNotEqual(12)</code> should return "Not Equal"
    testString: assert(testNotEqual(12) === "Not Equal");
  - text: <code>testNotEqual("12")</code> should return "Not Equal"
    testString: assert(testNotEqual("12") === "Not Equal");
  - text: <code>testNotEqual("bob")</code> should return "Not Equal"
    testString: assert(testNotEqual("bob") === "Not Equal");
  - text: You should use the <code>!=</code> operator
    testString: assert(code.match(/(?!!==)!=/));

Challenge Seed

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

testNotEqual(10);

Solution

function testNotEqual(val) {
  if (val != 99) {
    return "Not Equal";
  }
  return "Equal";
}