Select Git revision
conditionals.js
Forked from
SOFT Core / SOFT 260 / JavaScript Practice
Source project has a limited visibility.
-
Brady James Garvin authoredBrady James Garvin authored
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`;
}