Created
December 14, 2018 01:50
-
-
Save oneEyedSunday/5c5d24ae51335e748eb01acb9a8563b5 to your computer and use it in GitHub Desktop.
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
function isMultiple(number, baseNumber) { return !(number % baseNumber); } | |
for (var i = 1; i < 101; i++) { | |
if (isMultiple(i,3)){ | |
if (isMultiple(i,5)) { | |
console.log("FizzBuzz") | |
} else { | |
console.log("Fizz") | |
} | |
}else if(isMultiple(i,5)) { | |
console.log("Buzz") | |
} else { | |
console.log(i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment