JavaScript - Breaking Down The Shortest Possible FizzBuzz Answer

added by JavaScript Kicks
12/20/2017 9:09:50 AM

1057 Views

There are probably hundreds of different ways to solve FizzBuzz. Some are cleaner, faster, and better than others. Some are just plain crazy. In this article we're going to break down what appears to be the shortest solution to FizzBuzz (that I could find) for(let i=0;i<100;)console.log((++i%3?'':'fizz')+(i%5?'':'buzz')||i) Pretty fun, right?


0 comments