Skip to content

Instantly share code, notes, and snippets.

@jonrandy
Last active February 20, 2023 02:50
Show Gist options
  • Save jonrandy/41d627969174c5c133f1b8acfd2a8abd to your computer and use it in GitHub Desktop.
Save jonrandy/41d627969174c5c133f1b8acfd2a8abd to your computer and use it in GitHub Desktop.
FizzBuzz
const fizzBuzz = x=>[x,f='Fizz',b='Buzz',f+b][!(x%5)*2+!(x%3)]
const fizzBuzz = (x,f='Fizz',b='Buzz')=>[x,f,b,f+b][!(x%5)*2+!(x%3)]
const fizzBuzz = x=>({1:x,6:f="Fizz",10:b="Buzz",0:f+b}[x**4%15])
const fizzBuzz = (x,f="Fizz",b="Buzz")=>({1:x,6:f,10:b,0:f+b}[x**4%15])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment