Programming, Scala, Data Type, Abstraction, Introduction.
expression and thus yields a value. So, where you’d often use a statement, you may use as an expression to create cleaner, more readable code. Similar to the conditional operator in many languages, Scala’s if statement returns a value so you can change: var max = Int.MinValue if(a > b) max = a else