title: Difference between map and foreach method in Scala?
body: <p>I do have one big doubt when I started programming Scala. I want to know how the <code>map</code> method in scala works. Whether it's processing sequentially or in multithreaded? And more importantly I would like to know that why <code>map</code> method is faster than <code>while</code> or <code>foreach</code>? </p>
  
  <pre><code>val list = List(1,2,3,45,12)
  list.map(x =&gt; x)
  list.foreach(x =&gt; println(x))
  </code></pre>