I am trying to figure out an efficient way to remove objects that are duplicates from an array and looking for the most efficient answer. I looked around the internet everyt
function remove_duplicates(objectsArray) { var arr = [], collection = []; $.each(objectsArray, function (index, value) { if ($.inArray(value.id, arr) == -1) { arr.push(value.id); collection.push(value); } }); return collection; }