Back to Freecodecamp

Step 2

curriculum/challenges/english/blocks/workshop-countup/69447054012a22f38c944ff0.md

latest574 B
Original Source

--description--

Add an if statement inside your countup function.

Check if number is less than 1 and return an empty array.

This will serve as the base case for your recursion.

--hints--

When number is less than 1 the function should return an empty array.

js
assert.deepStrictEqual(countup(0), []);

When number is not less than 1 the function should not return anything.

js
assert.isUndefined(countup(1)); 

--seed--

--seed-contents--

js
function countup(number) {
--fcc-editable-region--
  
--fcc-editable-region--
}