...And the good! Stuck need help


#1


...And the good!


Oops, try again. It looks like you printed out the wrong number of items.

Replace this line with your code. 
var numbers =[1 , 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];


for(i=1;i<numbers.length; 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

== compares equality; means it checks if value are same.

=== strictly compare equality; means it checks if both value and data-type are same.

So, you should replace all == with === so that the condition statements checks to compare both value and data-type on the left and right hand side.

Also, this

should be

for(i=1;i<=numbers.length; i++)

I hope this resolves. :wink:


#3

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