@trashpanda001/helpers
    Preparing search index...

    Function uniq

    • Return a copy of the array removing all duplicated elements.

      The order of the elements is preserved.

      Type Parameters

      Parameters

      • array: readonly T[]

        the input array

      Returns T[]

      a new array with unique elements

      Unique numbers.

      import { uniq } from "@trashpanda001/helpers/array"

      uniq([1, 2, 3, 4, 3, 2, 1])
      // [1, 2, 3, 4]