I've implement uniqBy method as following.
Array.prototype.uniqBy = function (iteratee) {
  let uniques = [];
  for (let a of this) {
    const mappedUniques = uniques.map(iteratee);
    if (!mappedUniques.includes(iteratee(a))) {
      uniques.push(a);
    }
  }
  return uniques;
}
How to use this method:
let arrays = [
    {id: 1, value: 'm'},
    {id: 2, value: 'cm'},
    {id: 3, value: 'km'},
    {id: 2, value: 'cm2'}
];
console.log(arrays.uniqBy(x => {return x.id}));
After this, will removed duplicate ids. So
[
    {id: 1, value: 'm'},
    {id: 2, value: 'cm'},
    {id: 3, value: 'km'}
]
But it's performance is not good.
Where is more good performance method or library?
Anyone please advice. Thanks.
 
    