what is dup Posted on 2011-11-22 In Ruby dup returns a copy (duplicate) of the object. In the above code, it isused to let you get back a shuffled copy of the Array, withoutshuffling the original.