dup returns a copy (duplicate) of the object. In the above code, it is
used to let you get back a shuffled copy of the Array, without
shuffling the original.
dup returns a copy (duplicate) of the object. In the above code, it is
used to let you get back a shuffled copy of the Array, without
shuffling the original.
type:
ri Object#dup
for more info.
Thanks,
Dave.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.