And the good


#1



And the good; Introduction to Objects I


it just seys: Oops, try again. It looks like you printed out the wrong number of items.
and in the console it ses Buzz once. Im confused?


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


#2

@matryas,

For the Javascript interpreter a semi-colon-; is an End-of-Statement indicator....

If you use

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

the corresponding code-block encapsulated in a pair of curly-brackets { } is NOT executed !!!!

And read the instuctions carefully
and then change the FOR-loop condition.....!!!


#3

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