DEV Community


Discussion on: What do you think about the ternary operator?

soerenfandrich profile image
Sören Fandrich

It's like an if-else in Scala, that returns a value. Nothing wrong with that, it's just that ? : is not intuitive to read. But if used carefully, and not just showing off how smart you are ;-) it can actually improve readability.