Stuck!


#1

Hi there, I'm stuck. It keeps on saying that I printed out the wrong number of items. I used JS hint to check the code for bugs and there are none. It seems to be running through each parameter once, but not more than that. Any Ideas?!?
for(var i=0; i<=20; i++);{

if(i/3) {
console.log("Fizz");
}
if (i/5){
console.log("Buzz");
}

if (i/5 && i/3){
console.log("FizzBuzz");
}

else{
console.log(i);
}
}


#2

Hi you to check of the remain of the division is equal to 0 so you should use % instead of /

for example

12 %  3 === 0 // is true

#3

Try adding the "%" and check if it is equal to zero

For example
counter%5===0

To check both of them use the code below

if(counter%5===0 && counter%3===0){
console.log("FizzBuzz");
}


#4

I did what you said and added counter% === 0 It still says "you printed out the wrong number of items"
When I run the code, it shows Fizz and 21 (which shouldn't be printed given that the range is 1-20)

Here's what I have:

for(var Numb=1; Numb<=20; Numb++);{

if(Numb%3 === 0) {
console.log("Fizz");
}
if (Numb%5 === 0){
console.log("Buzz");
}

if (Numb%5 === 0 && Numb%3 === 0){
console.log("FizzBuzz");
}

else{
console.log(Numb);
}
}


#5

try position the && in the beginning.

DO NOT add a semicolon ( ; ) at the end of for "for ();{ "

Just like this.

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

}

#6

OMG u wonderful person!
Thanks