WHERES THE MISTAKE. Help me out You printed FizzBuzz when you should have printed Buzz


#1

var numbers=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
for (var i=0;i<numbers.length;i++)
{
if (numbers[i]%3 && numbers[i]%5==0)
{
console.log("FizzBuzz");
}
else if(numbers[i]%3===0 )
{
console.log("Fizz");
}
else if(numbers[i]%5===0)
{
console.log("Buzz");
}
else
{
console.log(numbers[i]);
}
}


#2

if (numbers[i]%3 === 0 && numbers[i]%5 === 0)

#3

Thanks :slight_smile:


#4

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