Why I can write something like this without compilation errors:
wordCount foreach(x => println("Word: " + x._1 + ", count: " + x._2)) // wordCount - is Map
i.e. I declared the x
variable.
But I can't use magic _
symbol in this case:
wordCount foreach(println("Word: " + _._1 + ", count: " + _._2)) // wordCount - is