I have an array of object which might include duplicate values.
I want those array index variable value to true if those indexes has duplicate values.
Let say I have below array of objects
let arr = [
{
name :'abc',
age : 20,
},
{
name :'xyz',
age : 25,
},
{
name :'pqr',
age : 22,
},
{
name :'abc',
age : 27,
},
{
name :'abc',
age : 26,
},
]
so there is 3rd and 4th index which has duplicate name as 0th index. I want to set isError variable to true for 3rd and 4th index and for others I would like to set to false.
Any help would be great.
Thank you.