Hey,
Used with a loop, yield produces a value for each iteration. Another way to do is to use map/ flat Map and filter with nomads:
Here is an example:
scala> for(i<-1 to 4) yield i*3
The output will be:
scala.collection.immutable.IndexedSeq[Int] = Vector(3, 6, 9, 12)