3 and the good


#1

need help please it shows
for (var i=1; i<21; i++) {
if (i % 3 === 0 ) {
console.log("Fizz")
}
else if (i % 5 === 0) {
console.log("Buzz")
}
else if (i %(3 && 5)) {
console.log ("FizzBuzz")
}
else {
console.log (i)
}
};

`
https://www.codecademy.com/courses/spencer-sandbox/0/3?curriculum_id=506324b3a7dffd00020bf661#


#2

make the code check for fizzbuzz first and then the other two.


#3

you might have to change this to check both. I'm not sure though, ive seen this method used before but I don't know if it will work or not.
if it doesn't then you might change it to

if(i % 3 == 0 && i % 5 == 0)


#4

thanks but it had to do with the order i start by assign the last operations and go up


#5

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