The link to this question I’m having issues with is https://www.codecademy.com/exams/journeys/full-stack-engineer/paths/fscj-22-interview-prep/parts/2.
The problem I am having with this question is as follows:
In the coding below which I have pasted below, I have created a recursive function which seems to work and produce the desired output. However when checking the answer on code academy, it will not pass the solution as correct. Instead it will output:
“Did you make a recursive call to countDownRecursive()
with count
decremented?”
I clearly have done this in my coding but this message keeps popping up. Any ideas why this may be? Is there a fault with my coding or is this a glitch on CodeAcademy?
function countDownIterative(count) {
while(count>0) {
console.log(count);
count–;
}
console.log(‘Blast Off~!’);
}
console.log(‘Iterative Countdown:’);
countDownIterative(3);
function countDownRecursive(count) {
if (count ==0){
console.log(“Blast off”)
}
else{
console.log(count)
count–
countDownRecursive(count)
}
}
console.log(‘Recursive Countdown:’);
countDownRecursive(3);