Not sure what I am doing wrong.
Your code so far
// Only change code below this line
function countdown(n){
if (n <= 1) {
return [];
} else {
const countArray = countdown(n - 1);
countArray.push(n);
return countArray;
}
}
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Use Recursion to Create a Countdown
Link to the challenge: