title: what's different between each and collect method in Ruby
body: <p>From this code I don't know the difference between the two methods, <code>collect</code> and <code>each</code>.</p>
  
  <pre><code>a = ["L","Z","J"].collect{|x| puts x.succ} #=&gt; M AA K 
  print  a.class  #=&gt; Array
  
  b = ["L","Z","J"].each{|x| puts x.succ} #=&gt; M AA K
  print  b.class #=&gt; Array
  </code></pre>