Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by winrid

18 hours ago

you can flip it and save a few bytes, but not valid fizzbuzz then:

for(i=100;i--;console.log(i%5?f||i:f+'Buzz'))f=i%3?'':'Fizz'

2 comments

winrid

Reply

embedding-shape  18 hours ago

> but not valid fizzbuzz then

Well, if we let that requirement be broken, I'll present an even shorter JS version:

    1

  • winrid  6 hours ago

    just thought it was fun. thanks for your reply.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities