Function sortedUniq

  • 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.

    Since

    5.12.0

    Example

    sortedUniq([1, 1, 2])
    // => [1, 2]

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to inspect.

    Returns T[]

    Returns the new duplicate free array.