W
William James
James said:Array.uniq!
???
James Edward Gray II
irb(main):008:0> a=[1,1,2,2,3,3]
=> [1, 1, 2, 2, 3, 3]
irb(main):009:0> a.no_dup!(2)
=> [1, 1, 2, 3, 3]
irb(main):010:0> a.uniq!(3)
ArgumentError: wrong number of arguments (1 for 0)
from (irb):10:in `uniq!'
from (irb):10
irb(main):011:0> a.uniq!
=> [1, 2, 3]
Array#uniq is "massively destructive".