Answers for "how to delete duplicate object from array in javascript"

0

remove duplicates objects from array javascript

arr.reduce((acc, current) => {
  const x = acc.find(item => item.id === current.id);
  if (!x) {
    return acc.concat([current]);
  } else {
    return acc;
  }
}, []);
Posted by: Guest on November-09-2020

Code answers related to "how to delete duplicate object from array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language