Predicate for validating an array for uniqueness. Returns true when el is the first occurrence in source, false otherwise. Intended for use as an Array.filter callback. Not generally meant for external use.
true
el
source
false
Array.filter
[1, 2, 2, 3].filter(arr_uniq_p); // [1, 2, 3] Copy
[1, 2, 2, 3].filter(arr_uniq_p); // [1, 2, 3]
The current element being tested.
The index of the current element.
The full array being filtered.
true if el is the first occurrence in source.
Predicate for validating an array for uniqueness. Returns
truewhenelis the first occurrence insource,falseotherwise. Intended for use as anArray.filtercallback. Not generally meant for external use.