I am able to get the output according the needs but it is not executing , can anyone check what is wrong with the code ???
// Only change code below this line
let array = [];
function countdown(n){
if(n>=1){
array.push(n);
countdown(n-1);
return array;
}else {
return [];
}
// return;
}
// Only change code above this line
console.log(countdown(10));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36 Edg/101.0.1210.32
Challenge: Use Recursion to Create a Countdown
Link to the challenge: