I need to find true of false if my array contain duplicate object value.
Suppose I have this array of objects
const array = [
{
id: "id1",
quantity: 3,
variation: "red",
tax: 40
},
{
id: "id1",
quantity: 3,
variation: "red",
tax: 40
},
{
id: "id2",
quantity: 3,
variation: "red",
tax: 40
}
]
Here I have to get true because here id1 come twice in this array. If This array contain unique id everywhere then it should return false. How can I do that. I am not getting proper solution.
forloop.