Gets a new array with only distinct elements. Only primitive values (string, number, boolean, etc) are compared.
The type of elements in the array.
The target array.
A new array containing only unique elements.
const mynumbers = [0, 1, 2, 2, 2, 5, 6, 7, 7, 7]console.log(PUtilsArray.distinct(mynumbers)) Copy
const mynumbers = [0, 1, 2, 2, 2, 5, 6, 7, 7, 7]console.log(PUtilsArray.distinct(mynumbers))
Gets a new array with only distinct elements. Only primitive values (string, number, boolean, etc) are compared.