freeCodeCamp/curriculum/challenges/arabic/02-javascript-algorithms-an.../basic-javascript/use-multiple-conditional-te...

1.1 KiB

id title challengeType videoUrl localeTitle
587d7b7e367417b2b2512b21 Use Multiple Conditional (Ternary) Operators 1

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'assert(/.+?\s*?\?\s*?.+?\s*?:\s*?.+?\s*?\?\s*?.+?\s*?:\s*?.+?/gi.test(code), "<code>checkSign</code> should use multiple <code>conditional operators</code>");'
  - text: ''
    testString: 'assert(checkSign(10) === "positive", "<code>checkSign(10)</code> should return "positive". Note that capitalization matters");'
  - text: ''
    testString: 'assert(checkSign(-12) === "negative", "<code>checkSign(-12)</code> should return "negative". Note that capitalization matters");'
  - text: ''
    testString: 'assert(checkSign(0) === "zero", "<code>checkSign(0)</code> should return "zero". Note that capitalization matters");'

Challenge Seed

function checkSign(num) {

}

checkSign(10);

Solution

// solution required