diff --git a/fizzbuzz.js b/fizzbuzz.js index bd1f6cf..8abbfc2 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -6,10 +6,18 @@ 'use strict'; -var fizzbuzz = function (x) { -// -// YOUR CODE GOES HERE -// -}; +let fizzbuzz = function (number) { + if ((number % 3 === 0) && (number % 5 === 0)) { + console.log("fizzbuzz"); + } else if (number % 3 === 0) { + console.log("fizz"); + } else if (number % 5 === 0) { + console.log("buzz"); + } else { + console.log(number); + } +} + +fizzbuzz(15); module.exports = { fizzbuzz: fizzbuzz };