DEV Community

Discussion on: Unconditional Challenge: FizzBuzz without `if`

Collapse
bashunaimiroy profile image
Bashu Naimi-Roy

I'm thinking of an absolutely egregious version using try and catch, but I'm going to go ahead and assume that try/catch would be a "surrogate conditional"

Collapse
kallmanation profile image
Nathan Kallman Author

😂 it probably is, but now I want to see it implemented with just try/catch!

Collapse
sharpninja profile image
The Sharp Ninja

The trigger is simply 1/(n%3). You just print "Fizz" on a division by Zero.