title: How to iterate over a Map in Kotlin
body: <p>So I am new to Kotlin and I am wondering what's the standard way of iterating a Map. I have tried different ways and all of them seem to work, but I don't know if there's one better than the rest or there are some differences that I am not aware of.</p>
  <pre><code>    var mutMap = mutableMapOf(&quot;one&quot; to 1, &quot;two&quot; to 2, &quot;tree&quot; to 3, &quot;four&quot; to 4, &quot;five&quot; to 5)
  
      mutMap.forEach { entry -&gt; println(entry) }
  
      mutMap.iterator().forEach { entry -&gt; println(entry) }
  
      mutMap.entries.forEach { entry -&gt; println(entry) }
  
      mutMap.entries.iterator().forEach { entry -&gt; println(entry) }
  
      for (entry in mutMap) { println(entry) }
  
      for (entry in mutMap.entries) { println(entry) }
  
      for (entry in mutMap.iterator()) { println(entry) }
  
      for (entry in mutMap.entries.iterator()) { println(entry) }
  </code></pre>
  <p>Also, if I wanted to also delete an entry while iterating over them, none of them would work, right?</p>