title: Array map vs. forEach in Swift
body: <p>In Swift arrays you can do:</p>
  
  <pre><code>var myArray = [1,2,3,4]
  
  myArray.forEach() { print($0 * 2) }
  
  myArray.map() { print($0 * 2) }
  </code></pre>
  
  <p>They both do the same thing. The only difference is .map also returns an array of voids as well, <code>[(),(),(),()]</code>, which gets unused. Does that mean .map performs worse than .forEach when it's not assigning to anything?</p>