Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions fizzbuzz.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
// Make sure to look at test.script.js--that should give you some hints about what is
// expected here.

'use strict';


var fizzbuzz = function (x) {
//
// YOUR CODE GOES HERE
//

if ( x % 15 == 0) {
return "FizzBuzz";
}
else if (x % 3 == 0) {
return "Fizz";
}
else if (x % 5 == 0) {
return "Buzz";
}
else {
return x;
}
};

module.exports = { fizzbuzz: fizzbuzz };