it should also be mentioned that a block can be given if the uniqueness constraint is more complex; for instance, you could do
array.uniq { |i| i % 3 }
to get the unique values modulo 3 (1, 2, 6)