Insert a element into an array if the element not exists.
The target array.
The element to insert.
It returns true if the element was inserted.
true
const mynumbers = [0, 1, 2]console.log(PUtilsArray.distinct(mynumbers, 3)) // trueconsole.log(PUtilsArray.distinct(mynumbers, 3)) Copy
const mynumbers = [0, 1, 2]console.log(PUtilsArray.distinct(mynumbers, 3)) // trueconsole.log(PUtilsArray.distinct(mynumbers, 3))
Insert a element into an array if the element not exists.