Answers for "array object remove duplicate"

-1

remove duplicates objects from array javascript

function remove_duplicate_objects(data,prop) {
    var seen = {};
    data = data.filter(function (entry) {
      if (seen.hasOwnProperty(entry[prop])) {
        return false;
      }

      seen[entry.prop] = entry;
      return true;
    });
    return data
  }

const new_array = remove_duplicate_objects([array with objects inside])
Posted by: Guest on February-23-2021

Code answers related to "array object remove duplicate"

Code answers related to "Javascript"

Browse Popular Code Answers by Language