3 ms·
Scala doesn't have a ternary operator as well.
by pkolaczk 7y ago
Scala doesn't have a ternary operator as well.
- madiathomas 7y agoI haven't used Scala before. What is their reasoning for that?
- melolife 7y agoIn Scala everything is an expression so you just use an if statement: val foo = if(x) y else z
- madiathomas 7y agoThanks. It makes sense because it doesn't have statement. Ternary operator wasn't going to be possible.