...And the good! ("It looks like you printed the wrong number of items.")


#1



https://www.codecademy.com/courses/spencer-sandbox/0/3?curriculum_id=506324b3a7dffd00020bf661


I receive the error "It looks like you printed the wrong number of items." Am I supposed to print "Fizz", "Buzz", etc. in the place of the numbers?


for (i = 0; i < 21; i++) {
    console.log(i)
if (( i  % 3 == 0) && (i % 5 == 0)) {
    console.log("FizzBuzz")
    } else if ((i % 3 == 0) && (i % 5 !== 0)) {
        console.log("Fizz")
        } else if ((i % 3 !== 0) && (i % 5 == 0))
        console.log("Buzz")
        }


#2

you're logging "buzz" if its not equally divisible by 3 or 5. you should be logging buzz if it is divisible by 5 and logging the variable i if its not divisible by 3 or 5.

for (i = 0; i < 21; i++) {
console.log(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 if ((i % 3 !== 0) && (i % 5 == 0))
console.log(i)
}


#3

Oh, okay. Thank you for explaining it to me.