3. ...And the good! *(FIZZBUZZ)*


#1


My code doesn't work and I can't seem to find the error. Keeps telling me that my syntax isn't good. Can someone please help me? I've been stuck for houuuurs.


var (var i=1;i<21;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

should be,

for (var i =1; i < 21; i++) {

#3

Wow... that was a stupid error lol. Thank you! :slight_smile: