Created
July 31, 2017 10:19
-
-
Save Chudesnov/4aa18d62574b28813b6fcdcdf5fe2788 to your computer and use it in GitHub Desktop.
The mighty FizzBuzz
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 = 0; i <= 100; i++) { | |
const divisibleByFive = !(i % 5); | |
const divisibleByThree = !(i % 3); | |
console.log(((divisibleByThree ? 'Fizz' : '') + (divisibleByFive ? 'Buzz' : '')) || i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment