@bnidev/js-utils
    Preparing search index...

    Function uniqueArray

    • Returns a new array with only unique elements from the input array.

      Type Parameters

      • T

      Parameters

      • arr: T[]

        The array to filter for unique values.

      Returns T[]

      A new array containing only unique elements.

      import { uniqueArray } from '@bnidev/js-utils'
      
      const arr = [1, 2, 2, 3, 4, 4, 5]
      const unique = uniqueArray(arr) // [1, 2, 3, 4, 5]