Both dup and clone return different objects, but modifying them alters the original object
I have an array of values that I use as a reference for order when I'm printing out hash values. I'd like to modify the array so that the array values are "prettier". I figured I'd just dup or clone the array, change the values and the original object would remain unchanaged. However (in irb)... @arr = ['stuff', 'things'] a = @arr.clone b = @arr.dup So, at the very least, a and @arr are different objects: a.object_id == @arr.object_id => false But now it gets strange a[0].capitalize! a => ['Stuff', 'things'] @arr => ['Stuff', 'things'] ##<-what? b => ['Stuff', 'things']## <-what??? ok... so