Skip to content

Instantly share code, notes, and snippets.

@ikasoba
Last active March 6, 2022 08:04
Show Gist options
  • Save ikasoba/0d477984628d41f67a571763e71f12dc to your computer and use it in GitHub Desktop.
Save ikasoba/0d477984628d41f67a571763e71f12dc to your computer and use it in GitHub Desktop.
fizz buzzをワンライナーで書いた
Array.from({length:500},(_,n)=>((i=n+1)=>(i%3==0) + (i%15==0) + (i%5==0)*2)()).map((x,i)=>x&1 ? "Fizz" : x&2 ? "Buzz" : x&4 ? "Fizz Buzz" : i+1).forEach((m)=>console.log(m))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment