Answers for "how to don't duplica objects in an array in javascript"

1

how to remove duplicate array object in javascript

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

const obj = [...new Map(person.map(item => [JSON.stringify(item), item])).values()];
console.log(obj);
Posted by: Guest on April-22-2020

Code answers related to "how to don't duplica objects in an array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language