title: Why doesnt this ruby code work as expected?
body: <p>I am working on learning some Hash operations in ruby. The code is about increasing each item's price by 10%. Why doesn't this code work?</p>
  
  <pre><code>restaurant_menu = { "Ramen" =&gt; 3, "Dal Makhani" =&gt; 4, "Coffee" =&gt; 2 }
  restaurant_menu.each do |item, price|
    price = price + (price * 0.1)
  end
  </code></pre>
  
  <p>while this one does:</p>
  
  <pre><code>restaurant_menu = { "Ramen" =&gt; 3, "Dal Makhani" =&gt; 4, "Coffee" =&gt; 2 }
  restaurant_menu.each do |item, price|
    restaurant_menu[item] = price + (price * 0.1)
  end
  </code></pre>
  
  <p>And any reasons as to why the latter is a better way to do it than the former as explained by @Mike Manfrin?</p>