iterating

How to iterate over Scala Lists with foreach and for

Scala List/sequence FAQ: How do I iterate over a Scala List using the foreach method or for loop?

There are a number of ways to iterate over a Scala List using the foreach operator and for comprehension, and I'll show a few of those approaches here.