var array = [{
name: "Mango",
weight: "15gm"
}, {
name: "Banana",
weight: "10gm"
}, {
name: "Apple",
weight: "15gm"
}, {
name: "Grapes",
weight: "5gm"
}, {
name: "Banana",
weight: "15gm"
}];
I want to remove all other than Banana.
See here.
So given this input:
We get this output: