Answers for "remove duplicate array of 2objects javascript"

-1

remove duplicates from array of objects javascript

let arr = [{name: "john"}, {name: "jane"}, {name: "imelda"}, {name: "john"}];

const uniqueArray = arr.filter((v,i,a)=>a.findIndex(t=>(t.name===v.name))===i)
console.log(uniqueArray);
Posted by: Guest on June-21-2021

Code answers related to "remove duplicate array of 2objects javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language