Values & References7 / 16
Up next

Parameters are local

// n is a local copy of the caller's Int
def bump(n: Int): Int =
  var m = n
  m += 1
  m

@main def main(): Unit =
  val x = 5
  println(bump(x))
  // x is untouched
  println(x)
What you're solving

a value copy does not leak out