@sensimods/utility-lab
    Preparing search index...

    Function unique

    • Returns a new array with all duplicate elements removed. Works best with primitive values (strings, numbers, booleans).

      Type Parameters

      • T

      Parameters

      • arr: T[]

        The array to filter.

      Returns T[]

      A new array containing only unique values.

      unique([1, 2, 2, 3, 4, 4, 5]) // [1, 2, 3, 4, 5]