I am wondering how I can compare values within an array.
Here are two arrays:
var noRepeatStore = [];
var store = [
{name: "a"},
{name: "b"},
{name: "c"},
{name: "b"},
{name: "a"}
];
If the name
value is unique it should return true and push the non-repeated object to a new array.
The expected result:
noRepeatStore = [{name:"a"}, {name:"b"}, {name:"c"}];
Is there a way to achieve this?