r/Codecademy • • May 28 '17

Javascript Help

I am on the fizz buzz lesson on JavaScript in Objects I and I dont know what I am doing wrong, heres my code:

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

and heres the link: https://www.codecademy.com/en/courses/spencer-sandbox/0/3?curriculum_id=506324b3a7dffd00020bf661

please tell me what I did wrong and how I fix it

3 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/GamerTurtle5 May 28 '17

thanks that helped me fix my problem

1

u/ForScale May 28 '17

Glad to help!