Created
December 7, 2018 15:05
-
-
Save d4gh0s7/8ac0b4c1dc0fced36c075788d62acb42 to your computer and use it in GitHub Desktop.
A simple Fizz-Buzz Test in JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let config = { }; | |
config.fizzTest = 3; | |
config.buzzTest = 5; | |
config.checks = 100; | |
config.fizzText = 'Fizz'; | |
config.buzzText = 'Buzz'; | |
for (let i = 1; i <= config.checks; i++) { | |
let expletive = ''; | |
if (i % config.fizzTest === 0) expletive += config.fizzText; | |
if (i % config.buzzTest === 0) expletive += config.buzzText; | |
console.log(expletive || i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment