From e3ab015a67646623569be488c30eeacc075889f4 Mon Sep 17 00:00:00 2001 From: Olivier Guillemot Date: Mon, 6 Apr 2020 15:52:03 +0200 Subject: [PATCH 1/3] first try Olivier --- fizzbuzz.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index bd1f6cf..1526a9e 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -7,9 +7,16 @@ 'use strict'; var fizzbuzz = function (x) { -// -// YOUR CODE GOES HERE -// + if (x % 3 === 0 && x % 5 !==0){ + return "fizz" + } else if (x % 5 === 0 && x % 3 !==0){ + return "buzz" + } else if (x % 3 === 0 && x % 5 ===0){ + return "fizzbuzz" + }else { + return x + } }; module.exports = { fizzbuzz: fizzbuzz }; + From d7ed00701ed268f86a280feb928557c2576f9536 Mon Sep 17 00:00:00 2001 From: Olivier Guillemot Date: Mon, 6 Apr 2020 16:56:34 +0200 Subject: [PATCH 2/3] second try --- fizzbuzz.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index 1526a9e..055d79f 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -9,9 +9,9 @@ var fizzbuzz = function (x) { if (x % 3 === 0 && x % 5 !==0){ return "fizz" - } else if (x % 5 === 0 && x % 3 !==0){ + } else if (x % 5 === 0){ return "buzz" - } else if (x % 3 === 0 && x % 5 ===0){ + } else if (x % 3 === 0){ return "fizzbuzz" }else { return x From 8e3f5c989fc36a125038bcf264665969b902b46a Mon Sep 17 00:00:00 2001 From: Olivier Guillemot Date: Mon, 6 Apr 2020 17:00:00 +0200 Subject: [PATCH 3/3] third --- fizzbuzz.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index 055d79f..1526a9e 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -9,9 +9,9 @@ var fizzbuzz = function (x) { if (x % 3 === 0 && x % 5 !==0){ return "fizz" - } else if (x % 5 === 0){ + } else if (x % 5 === 0 && x % 3 !==0){ return "buzz" - } else if (x % 3 === 0){ + } else if (x % 3 === 0 && x % 5 ===0){ return "fizzbuzz" }else { return x