For Expressions

scala> val doubledNums = for (n <- nums) yield n * 2
doubledNums: Seq[Int] = List(2, 4, 6)

is a different use of the for construct. .

is used to create new collections from existing collections.

For Expressions → are a → Control Structures.

For Expressions — Structure map

Clickable & Draggable!

For Expressions — Related pages: