Fundamentals8 / 9
Up next

match expression

@main def main(): Unit =
  val day = 6
  // match returns the value of the first matching case
  val label = day match
    case 1 => "Mon"
    case 6 | 7 => "weekend"
    case _ => "other"
  println(label)
What you're solving

test a value against patterns