Tell us what’s happening:
Your code so far
// Only change code below this line
function countdown(n){
if(n < 1){
return []
}
else {
const arr = countdown (n - 1);
arr.push (n + 1);
return arr
}
}
countdown (-1);
countdown (10);
countdown (5)
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 4.4.2; GT-I9301I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36.
Challenge: Use Recursion to Create a Countdown
Link to the challenge: