3. ...And the Good!


#1


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


It looks like you printed out the wrong number of items.


Replace this line with your code.


#2

@bibleman13 I don't know what to put for the first line.


#3

Can you post the code you have right now as well?


#4

sure hold on :smile:


#5

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


#6

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

Oops, try again. You printed 3 when you should have printed Fizz


#7

Ok let me take a look at it and I will get back to you in a moment! :smiley:


#8

First off, you are missing an else if statement just like the one you made for Fizz except in this case you need 3 to equal Fizz.

Secondly, for this lesson it wants Fizz to equal 3 and the powers of 3 and Buzz to equal 5 and the powers of 5 so you want Buzz instead of Fizz in your else if statement with 5.


#9

I figured out what I did wrong


#10

thank you @bibleman13


#11

Haha no problem man! Glad you figured it out on your own as well! Debugging codes on your own is a great skill to develop while you're learning! :smiley:


#12