title: Destructive map method with control flow returns unexpected nils
body: <p>When I run this, it correctly changes the <code>3</code> in <code>array</code> to <code>"blue"</code>, but it changes all other elements to <code>nil</code>.</p>
  
  <pre><code>array = [1, 2, 3, 4]
  array.map! do |number|
    if number == 3
      array[number] = "blue"
    end
  end
  </code></pre>
  
  <p>Since I introduced the <code>if</code> statement, I expect it to leave everything else alone. Can someone explain why that's happening and how to get it to only modify the element isolated with the <code>if</code> statement?</p>