Skip to content

Instantly share code, notes, and snippets.

@taitruong
Created March 10, 2014 14:36
Show Gist options
  • Save taitruong/9466102 to your computer and use it in GitHub Desktop.
Save taitruong/9466102 to your computer and use it in GitHub Desktop.
two line operator, 2
object ScalaHackSession {
var a = 0 //> a : Int = 0
if (a < 10) a = a + 1
println(a) //> 1
if (a < 10) a = a
+ 1 //> res0: Int = 1
println(a) //> 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment