diff --git a/fizzbuzz.js b/fizzbuzz.js index bd1f6cf..bdb7252 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -4,12 +4,29 @@ // Make sure to look at test.script.js--that should give you some hints about what is // expected here. -'use strict'; + let fizzbuzz = function (x) { -var fizzbuzz = function (x) { -// -// YOUR CODE GOES HERE -// -}; - -module.exports = { fizzbuzz: fizzbuzz }; + let result; + + if (x %3===0){ + result = 'fizz'} + + if (x %5===0){ + result = 'buzz'} + + if (x %5===0 && x %3===0){ + result = 'fizzbuzz'} + + if (!(x %5===0 || x %3===0)){ + result = (x); + } + + console.log(result) ; + } + + fizzbuzz(2) + fizzbuzz(5) + fizzbuzz(6) + fizzbuzz(11) + fizzbuzz(30) +}; \ No newline at end of file