Values & References5 / 16
Up next

Immutable collections

@main def main(): Unit =
  val xs = List(1, 2, 3)
  // :+ returns a new list; xs is untouched
  val ys = xs :+ 4
  println(s"$xs $ys")
What you're solving

adding yields a new value