Created
June 14, 2019 20:13
-
-
Save KameronKales/494f0dc21227a0508890ecc0950fb2c6 to your computer and use it in GitHub Desktop.
A better fizzbuzz example
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
for (let i = 1; i < 101; i++) { | |
let solved = i % 15 === 0 ? `${i} is divisible by 15, FizzBuzz` : i % 3 === 0 ? `${i} is divisible by 3, Fizz` : i % 5 === 0 ? `${i} is divisible by 5, Buzz` : i | |
console.log(solved) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment