My 10 cents:
you should have said: FizzBuzz with a Cyclomatic Complexity to maximum 2 (or 1).
Because if you replace a if/else by Logical Operators, or Switch or While or For, you aren't doing better code in terms of Cyclomatic Complexity
The CSS approach is one of the most elegant.
Another one without any cyclomatic complexity is acheived with a strong type system, like what you can do in Haskell, F#; Kotlin or TypeScript
See that solution (not mine, but clever if you understand the type inference mecanism) gist.github.com/na-o-ys/34e9ebf7fc...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My 10 cents:
you should have said: FizzBuzz with a Cyclomatic Complexity to maximum 2 (or 1).
Because if you replace a if/else by Logical Operators, or Switch or While or For, you aren't doing better code in terms of Cyclomatic Complexity
The CSS approach is one of the most elegant.
Another one without any cyclomatic complexity is acheived with a strong type system, like what you can do in Haskell, F#; Kotlin or TypeScript
See that solution (not mine, but clever if you understand the type inference mecanism) gist.github.com/na-o-ys/34e9ebf7fc...