1 posts in total


Posts tagged

Keeping array elements uniq in Ruby

by Syed Aslam · 1 min read

With the uniq method you can remove duplicate elements from an array. However, calling uniq removes the duplicate elements and returns a new array with unique elemnts. It won't change the original array. You can use uniq! to remove duplicates in place. Another way is to only app ...