Skip to content
Snippets Groups Projects
Select Git revision
  • 60d83c8e5081cb4f45ae279f8e2013ffaebbb243
  • main default protected
2 results

conditionals.js

Blame
  • Forked from SOFT Core / SOFT 260 / JavaScript Practice
    Source project has a limited visibility.
    conditionals.js 574 B
    export function classify(number) {
      let description = 'not a';
      // INSTRUCTIONS: Use a chained conditional to set the variable `description`
      // to 'negative' when number is negative, 'zero' when number is zero, and
      // 'positive' when number is positive.  If number is none of those (for
      // example, if number is NaN), leave the description as it is.
      //
      // Resources:
      // <https://javascript.info/ifelse#several-conditions-else-if>
      // <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else>
      return `${description} number`;
    }