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.
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 }]
{Array}
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.
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 }]