title: Why do Scala maps print an extra value when iterating with foreach?
body: <p>When iterating through a map like so:</p>
  
  <pre><code>val powers = Map("Spark man" -&gt; "Electricity", "Bubble man" -&gt; "Fires Bubbles", "Guts man" -&gt; "No idea")
  println(powers.size)
  println(powers.foreach(man =&gt; println(man._1 + " -&gt; " + man._2)))
  </code></pre>
  
  <p>Why does it seem to produce a fourth item when printing as such:</p>
  
  <pre><code>3
  Spark man -&gt; Electricity
  Bubble man -&gt; Fires Bubbles
  Guts man -&gt; No idea
  ()
  </code></pre>
  
  <p>With the braces on the last line being the part confusing me.</p>
  
  <p>As you can probably tell I'm quite new to the language, so it's likely something simple, but I can't seem to find anything relating to this.</p>