Having an issue passing this exercise


#1

Hi everyone!
I am also having an issues passing this exercise. The error states "Oop, try again. It look like you printed out the wrong number of items,"
Here is my code:
var numbers = function(){
for (var i=0; i<20; i++) {
if(i % 3 === 0 && i % 5 === 0) {
console.log("FizzBuzz");
}else if(i % 3 === 0) {
console.log("Fizz");
}else if(i % 5 === 0) {
console.log("Buzz");
}else{
console.log(i);
}
}
};
please help. I have tried every trick I know.

Thanks In Advance


3. And the Good: What am I doing wrong?
#2

Two things. The SCT does not know that you have written a function so won't know how to call it. Write raw code without a function wrapper. Second thing is the interval over which the loop interates. 0..19 rather than 1..20. Fix these two things and your code is good.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.