Doing FizzBuzz programming test with only ternary operators

Speaking Computer on a Sunday when I should be enjoying brunch. I modified it a bit so you can see the number and what is happening with each, rather than follow the test rules to the letter. In the JS tab in the embedded CodePen pen below, I also included a much more readable way to do the test; it uses if/else statements to work the magic (rather than confusing, nested ternary operators).

See the Pen FizzBuzz using only ternary operators by tumolillo (@hellotumo) on CodePen.

Leave a Comment

Your email address will not be published. Required fields are marked *

 

%d bloggers like this: