Answers for "how to remove object from array based on duplicate parameter"

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 remove object from array based on duplicate parameter"

Code answers related to "Javascript"

Browse Popular Code Answers by Language