foreach

trait Collection[A] {
  def foreach(f: (A) => Unit): Unit
}

foreach applies the function f to each element in this collection, discarding any result. This function returns ().