I keep getting YOU PRINTED THE WRONG NUMBER OF ITEMS solution please


#1

for (var i = 1; 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);
}
};


#2

Hi you should print the number from 1-to-20 so this line

for (var i = 1; i < 20; i++)

this part

 i < 20

or you change the 20 with 21 or you change the < to <=


#3

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