O'Reilly logo
  • saeed Abooleet thinks this is interesting:

// for/yield scala> for (i <- Array(1,2,3)) yield i * 2 res0: Array[Int] = Array(2, 4, 6) // map scala> Array(1,2,3).map(_ * 2) res1: Array[Int] = Array(2, 4, 6)

From

Cover of Scala Cookbook

Note

Using yeild and map