title: Ruby String Arrays Overwriting Themselves?
body: <p>For some reason, string is getting rewritten as mirror by the operation mirror[j] = string[i]</p>
  
  <p>I have no idea why this would be, I'm not commanding it to. The outputs of my reverse(string) function will stop at the middle, like:
  ABCDEF -> FEDDEF
  but I'm trying to do:
  ABCDEF -> FEDCBA</p>
  
  <pre><code>def reverse(string)
    mirror = string
    i = string.length - 1
    j = 0
    while j &lt; string.length
      mirror[j] = string[i]
      puts(mirror)
      j = j + 1
      i = i - 1
    end
    return mirror
  end
  </code></pre>