Fizzbuzz not working


#1

prints to the console just fine, but the red pop-up says i got the wrong number of items

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

#2

Hi I think that you should begin to count from 1 instead of 0


#3

yeah , i just got that. interesting in place of zero it printed fizzbuzz,like it considers zero to be divisible with 3 and 5 without a leftover.
thanks


#4

You need to use Comparison Operators to check if the number is divisible by 3 AND NOT divisible by 5, divisible by 5 AND NOT divisible by 3, divisible by 3 AND 5, and other.


#5

Because % is not a simple division, it is checking the remainder. 0/3 remainder is 0 so 0===0 is true.