And the good!...too many numbers?!?


#1


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


I getting a whole bunch of numbers and am I supposed to be getting one answer


Replace this line with your code. 
var number = function() {
for (var i = 1; i < 21; 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);
        }
    }
};
numbers();


#2

Actually for this lesson your output should have many numbers. This is the output you are going for in this lesson:

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz

What is your output saying?


#3

my output is saying

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz


#4

Well that output is correct! Is your code getting an error? If not, your code is in perfect working order and you have nothing to worry about :smiley:


#5

awesome. Thanks bibleman13. I appreciate it


#6

No problem man! Glad to have helped :thumbsup:


#7

You know you didn't have to put it in a function. You did too much megasurfer35492.


#8

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