diff --git a/src/fizzbuzz.js b/src/fizzbuzz.js index e3ec3a8..c820de1 100644 --- a/src/fizzbuzz.js +++ b/src/fizzbuzz.js @@ -2,7 +2,23 @@ const answer = [] // Write your code below this line +const fizz = 3 +const buzz = 5 +for (let i = 1; i <= 15; i++){ + if (i % fizz === 0 && i % buzz === 0){ + answer.push('FizzBuzz') + } + else if (i % fizz == 0){ + answer.push('Fizz') + } + else if (i % buzz == 0){ + answer.push('Buzz') + } + else { + answer.push(i) + } +}