Quantcast
Channel: User Ja͢ck - Stack Overflow
Viewing all articles
Browse latest Browse all 44

Comment by Ja͢ck on Remove duplicate elements from array in Ruby

$
0
0
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)

Viewing all articles
Browse latest Browse all 44

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>