title: ruby assign array to another variable and when delete element from that assign variable deleted on original array also
body: <p>Am facing strange issue. I have an array below. </p>
  
  <pre><code>irb(main):007:0&gt; original_array = []
  =&gt; []
  irb(main):008:0&gt; original_array.push("word1")
  =&gt; ["word1"]
  irb(main):009:0&gt; original_array.push("word2")
  =&gt; ["word1", "word2"]
  irb(main):010:0&gt; puts "#{original_array.inspect}"
  ["word1", "word2"]
  =&gt; nil
  irb(main):011:0&gt;
  </code></pre>
  
  <p>So when I have assigned this array to another array variable,</p>
  
  <pre><code>irb(main):011:0&gt; assigned_array = []
  =&gt; []
  irb(main):012:0&gt; assigned_array = original_array
  =&gt; ["word1", "word2"]
  irb(main):013:0&gt;
  irb(main):014:0&gt; puts "#{assigned_array.inspect}"
  ["word1", "word2"]
  =&gt; nil
  irb(main):015:0&gt;
  </code></pre>
  
  <p>Now when I delete en element from the assigned_array its deleting from the original array also.</p>
  
  <pre><code>irb(main):015:0&gt; assigned_array.delete("word2")
  =&gt; "word2"
  irb(main):016:0&gt; puts "#{assigned_array.inspect}"
  ["word1"]
  =&gt; nil
  irb(main):017:0&gt; puts "#{original_array.inspect}"
  ["word1"]
  =&gt; nil
  </code></pre>
  
  <p>Am not sure whether its the actual behavior of ruby. If so then is there any way to assign the original_array to assigned_array variable when I delete an element from assigned_array which shouldn't delete from original_array?</p>