Search
If an array has duplicate items, then we can use uniq to remove all the duplicates.
uniq
As we can see, array2 does not have any duplicate items.
array2
Whereas, array1 still has the duplicate items.
array1
uniq returns a new array which removes all duplicate items.