Use Recursion to Create a Countdown different variable

Tell us what’s happening:
I am having a problem with this. Wrote the same code as the solution but with a different variable. it is showing an error.

  **Your code so far**

// Only change code below this line
function countdown(n){

   if (n < 1) {
  return [];
} else {
  const countArray = countup(n - 1);
  countArray.unshift(n);
  return countArray;
}

}
// Only change code above this line
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36

Challenge: Use Recursion to Create a Countdown

Link to the challenge:

countup is not a defined function.

3 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.