Y
Hacker News
new
|
ask
|
show
|
jobs
by
pkolaczk
2382 days ago
Scala doesn't have a ternary operator as well.
1 comments
madiathomas
2382 days ago
I haven't used Scala before. What is their reasoning for that?
link
melolife
2382 days ago
In Scala everything is an expression so you just use an if statement:
val foo = if(x) y else z
link
madiathomas
2382 days ago
Thanks. It makes sense because it doesn't have statement. Ternary operator wasn't going to be possible.
link