I'd like to remove duplicate arrays in javascript from this array: In this case i wish to remove the blue color
var fruits = [
{
'color':'red',
'name': 'redName'
},
{
'color':'blue',
'name': 'blueName'
},
{
'color':'blue',
'name': 'blueName'
},
{
'color':'yellow',
'name': 'yellowName'
},
];
for(let i=0; i < fruits.length; i++)
{
if(indexOf(fruits[i]) == -1)
newarray.push(fruits[i]);
}
console.log(newarray);