DEV Community

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

Collapse
 
sake_92 profile image
Sakib Hadžiavdić • Edited

I prefer if expressions (e.g. in Scala):
val res = if(a) 1 else if(b) 2 else 3
It just feels more natural and concise