Skip to content

Instantly share code, notes, and snippets.

@tomatohammado
Last active December 1, 2017 21:27
Show Gist options
  • Select an option

  • Save tomatohammado/9c3a15102095d1e5111b3a5cc756c243 to your computer and use it in GitHub Desktop.

Select an option

Save tomatohammado/9c3a15102095d1e5111b3a5cc756c243 to your computer and use it in GitHub Desktop.
fancy fizbuzz
for (let i = 1; i <= 100; i++) {
let isDivisibleByThree = i % 3 === 0
let isDivisibleByFive = i % 5 === 0
isDivisibleByThree && isDivisibleByFive ?
console.log('FizzBuzz')
: isDivisibleByThree ?
console.log('Fizz')
: isDivisibleByFive ?
console.log('Buzz')
:
console.log(i)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment