Skip to main content
1 of 2

You can usually use map instead of foreach:

List("a","b","c") foreach println

can be replaced with

List("a","b","c") map println

except for the return type, which you aren't interested in anyway when using foreach.