title: Help me decipher this output
body: <p>I have started learning Ruby recently and I was trying out the following piece of code.</p>
  
  <pre><code>a=[1,2]
  b='slam dunk'
  a.each { |b| c=a*b; puts c;}
  </code></pre>
  
  <p>I am getting the following output. I have no clue why. I expected an error or something to be thrown. Can someone explain me why this happens?</p>
  
  <pre><code>1
  2
  1
  2
  1
  2
  </code></pre>
  
  <p>Thanks</p>