Hello guys, Kindly tell me why the code below doesn’ t work
function countdown(n){
if(n < 1){
return [];
} else {
const countArray = countup( n - 1 );
countArray.unshift(n);
return countArray;
}
}
Hello guys, Kindly tell me why the code below doesn’ t work
function countdown(n){
if(n < 1){
return [];
} else {
const countArray = countup( n - 1 );
countArray.unshift(n);
return countArray;
}
}
Do you have a typo? It looks like your code calls countup when you mean to call countdown.
Thanks @JeremLT that was actually where the mistake was but I have rectified it and it Worked. Thanks once again