freeCodeCamp/curriculum/challenges/arabic/02-javascript-algorithms-an.../basic-javascript/logical-order-in-if-else-st...

1.1 KiB

id title challengeType videoUrl localeTitle
5690307fddb111c6084545d7 Logical Order in If Else Statements 1

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'assert(orderMyLogic(4) === "Less than 5", "<code>orderMyLogic(4)</code> should return "Less than 5"");'
  - text: ''
    testString: 'assert(orderMyLogic(6) === "Less than 10", "<code>orderMyLogic(6)</code> should return "Less than 10"");'
  - text: ''
    testString: 'assert(orderMyLogic(11) === "Greater than or equal to 10", "<code>orderMyLogic(11)</code> should return "Greater than or equal to 10"");'

Challenge Seed

function orderMyLogic(val) {
  if (val < 10) {
    return "Less than 10";
  } else if (val < 5) {
    return "Less than 5";
  } else {
    return "Greater than or equal to 10";
  }
}

// Change this value to test
orderMyLogic(7);

Solution

// solution required