Returns a new array with only unique elements from the input array.
The array to filter for unique values.
A new array containing only unique elements.
import { uniqueArray } from '@bnidev/js-utils' Copy
import { uniqueArray } from '@bnidev/js-utils'
const arr = [1, 2, 2, 3, 4, 4, 5]const unique = uniqueArray(arr) // [1, 2, 3, 4, 5] Copy
const arr = [1, 2, 2, 3, 4, 4, 5]const unique = uniqueArray(arr) // [1, 2, 3, 4, 5]
Returns a new array with only unique elements from the input array.