foreach is unusual among the collections iterators in that it does not return a result. Instead it applies a function to each element that has only side effects. For example:
scala> val x = List(1,2,3)
x: List[Int] = List(1, 2, 3)
scala> x.foreach { println }
1
2
3
The function sup...