From 6cc37a207ec46e0a924039309455c7fcbccfbf96 Mon Sep 17 00:00:00 2001 From: Anthony5997 Date: Thu, 4 Feb 2021 14:53:11 +0100 Subject: [PATCH] Premier commit fizzbuzz fini --- fizzbuzz.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index bd1f6cf..8697951 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -7,9 +7,25 @@ 'use strict'; var fizzbuzz = function (x) { -// -// YOUR CODE GOES HERE -// -}; + var i; + for (i = 0; i <= 100; i++) { + + if (i % 5 == 0 && i % 6) { + + console.log("fizzbuzz"); + + } else if(i % 5 == 0) { + + console.log("fizz"); + + } else if(i % 6 == 0) { + + console.log("buzz"); + + } else{ + console.log(i); + } + } +} module.exports = { fizzbuzz: fizzbuzz };