📅  最后修改于: 2022-03-11 14:58:57.444000             🧑  作者: Mango
function countdown(n) {
if (n < 1) {
return [];
} else {
const arr = countdown(n - 1);
arr.unshift(n);
return arr;
}
return myArray;
}
console.log(countdown(-1));