Can anyone help me with why the following question keeps throwing up an error?

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);

Did you mean to write,

count--;

?

In your recursive function you can write it in the function call,

countDownRecursive(count--)
1 Like

I can’t view the specifications in the instructions, but make sure you follow them strictly. In the two versions posted by you, the blast off string differs. If that is how the instructions specified it, then its fine. Otherwise, make sure all outputs (prints/returns) match the requirements exactly including capitalization, punctuation etc.