Function
The arrUnique() method returns a new array with duplicate elements removed. Uses strict equality (===) for comparison and maintains insertion order.
Identifies the base type of array elements
The array or array-like object to remove duplicates from
A new array with duplicate values removed, preserving order of first occurrence
0.14.0
arrUnique([1, 2, 2, 3, 1, 4]); // [1, 2, 3, 4]arrUnique(["a", "b", "a", "c"]); // ["a", "b", "c"]arrUnique([1, "1", 1, "1"]); // [1, "1"]arrUnique([]); // []arrUnique([1]); // [1]// Array-like objectsarrUnique({ length: 4, 0: 1, 1: 2, 2: 2, 3: 3 }); // [1, 2, 3] Copy
arrUnique([1, 2, 2, 3, 1, 4]); // [1, 2, 3, 4]arrUnique(["a", "b", "a", "c"]); // ["a", "b", "c"]arrUnique([1, "1", 1, "1"]); // [1, "1"]arrUnique([]); // []arrUnique([1]); // [1]// Array-like objectsarrUnique({ length: 4, 0: 1, 1: 2, 2: 2, 3: 3 }); // [1, 2, 3]
The arrUnique() method returns a new array with duplicate elements removed. Uses strict equality (===) for comparison and maintains insertion order.