class Array

def deep_dup

dup[1][2] # => 4
array[1][2] # => nil

dup[1][2] = 4
dup = array.deep_dup
array = [1, [2, 3]]

Returns a deep copy of array.
def deep_dup
  map(&:deep_dup)
end