Creates a duplicate-free version of an array, it accepts iteratee which is invoked for each element in array to generate the criterion by which uniqueness is computed.
{Array}
uniqBy([2.1, 1.2, 2.3], Math.floor);// returns [2.1, 1.2] Copy
uniqBy([2.1, 1.2, 2.3], Math.floor);// returns [2.1, 1.2]
uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');returns [{ 'x': 1 }, { 'x': 2 }] Copy
uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');returns [{ 'x': 1 }, { 'x': 2 }]
Generated using TypeDoc
Creates a duplicate-free version of an array, it accepts iteratee which is invoked for each element in array to generate the criterion by which uniqueness is computed.