This method is like uniq except that it only works for sorted arrays. If the input array is known to be sorted sortedUniq is faster than uniq.
uniq
sortedUniq
The array to inspect.
Returns the new duplicate free array.
5.12.0
sortedUniq([1, 1, 2])// => [1, 2] Copy
sortedUniq([1, 1, 2])// => [1, 2]
This method is like
uniq
except that it only works for sorted arrays. If the input array is known to be sortedsortedUniq
is faster thanuniq
.