Browser Crash! Please Help


#1
  1. And the good!

After click "Save & Submit Code", the browser is crash. What's wrong? This is my code:

function fizzBuzz(){
for(var i = 1; 1 < 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);
                    };
    
};

fizzBuzz(15);

#2

In your second line of code, try replacing 1 with i

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

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

#3

OMG, thank dude... :sweat_smile:


#4

glad I could help ..


#5

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