3 ...And the Good


#1

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

unexpected token else??


#2

Hi try to remove the ; after each statement

if(i % 5 === 0 && i % 3 === 0) {
            console.log("Fizzbuzz");   
    }; <== this one

Do the same for the others.


#3

it crashed like it was an infinite loop :confused:


#4

Your for loop

for(var i = 1; 1 <= 20; i++)

You put 1 <= 20 instead of i <= 20


#5

OH THAT'S EMBARRASSING (but thank you)