Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
melolife
· 6y ago · 0 comments
In Scala everything is an expression so you just use an if statement:
val foo = if(x) y else z
Comments
[–]
madiathomas
6y ago
Thanks. It makes sense because it doesn't have statement. Ternary operator wasn't going to be possible.