Skip to content

Instantly share code, notes, and snippets.

@Chudesnov
Created July 31, 2017 10:19
Show Gist options
  • Save Chudesnov/4aa18d62574b28813b6fcdcdf5fe2788 to your computer and use it in GitHub Desktop.
Save Chudesnov/4aa18d62574b28813b6fcdcdf5fe2788 to your computer and use it in GitHub Desktop.
The mighty FizzBuzz
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