I have scala map:
attrs: Map[String , String]
When I try to iterate over map like;
attrs.foreach { key, value => }
the above does not work. In each iteration I must know what is the key and what is the value. What is the proper way to iterate over scala map using scala syntactic sugar?
foreachmethod receivesTuple2[String, String]as argument, not 2 arguments. So you can either use it like tuple:or you can make pattern match: