Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
val someNumber = 5
val evenOrOdd = someNumber match {
case 1 | 3 | 5 | 7 | 9 => println("odd")
case 2 | 4 | 6 | 8 | 10 => println("even")
}
println(evenOrOdd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.