DEV Community

Discussion on: Fizz Buzz Solution JavaScript

Collapse
 
antogarand profile image
Antony Garand

How about a shorter one liner?

Still using the ternary operators, but using a bit of magic as well.

JavaScript, 62 bytes

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

I think I this is the shortest Javascript solution now.