SomeDer bfa5c26288 fix: use dfn instead of code tag (#36640)
* Use dfn tags

* remove misused <dfn> tags

* Revert "remove misused <dfn> tags"

This reverts commit b24968a96810f618d831410ac90a0bc452ebde50.

* Update curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/fill-in-the-blank-with-placeholder-text.english.md

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* Make "array" lowercase

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* Fix dfn usage

* Address last dfn tags
2019-10-27 12:45:37 -04:00

2.5 KiB

id, title, challengeType, videoUrl, forumTopicId
id title challengeType videoUrl forumTopicId
56533eb9ac21ba0edf2244d4 Comparison with the Greater Than Operator 1 https://scrimba.com/c/cp6GbH4 16786

Description

The greater than operator (>) compares the values of two numbers. If the number to the left is greater than the number to the right, it returns true. Otherwise, it returns false. Like the equality operator, greater than operator will convert data types of values while comparing. Examples
5   >  3   // true
7   > '3'  // true
2   >  3   // false
'1' >  9   // false

Instructions

Add the greater than operator to the indicated lines so that the return statements make sense.

Tests

tests:
  - text: <code>testGreaterThan(0)</code> should return "10 or Under"
    testString: assert(testGreaterThan(0) === "10 or Under");
  - text: <code>testGreaterThan(10)</code> should return "10 or Under"
    testString: assert(testGreaterThan(10) === "10 or Under");
  - text: <code>testGreaterThan(11)</code> should return "Over 10"
    testString: assert(testGreaterThan(11) === "Over 10");
  - text: <code>testGreaterThan(99)</code> should return "Over 10"
    testString: assert(testGreaterThan(99) === "Over 10");
  - text: <code>testGreaterThan(100)</code> should return "Over 10"
    testString: assert(testGreaterThan(100) === "Over 10");
  - text: <code>testGreaterThan(101)</code> should return "Over 100"
    testString: assert(testGreaterThan(101) === "Over 100");
  - text: <code>testGreaterThan(150)</code> should return "Over 100"
    testString: assert(testGreaterThan(150) === "Over 100");
  - text: You should use the <code>&gt;</code> operator at least twice
    testString: assert(code.match(/val\s*>\s*('|")*\d+('|")*/g).length > 1);

Challenge Seed

function testGreaterThan(val) {
  if (val) {  // Change this line
    return "Over 100";
  }

  if (val) {  // Change this line
    return "Over 10";
  }

  return "10 or Under";
}

// Change this value to test
testGreaterThan(10);

Solution

function testGreaterThan(val) {
  if (val > 100) {  // Change this line
    return "Over 100";
  }
  if (val > 10) {  // Change this line
    return "Over 10";
  }
  return "10 or Under";
}