How to filter objects in array based on unique property
here i have an array where KEY is the key value in the objects.
How to filter the objects where key value is unique. Key
var uniqueArray = []
for (var i = 0; i < array.length; i++) {
var uniquevalue = array[i];
unique[array.KEY] = uniquevalue;
}
for (var name in unique) {
var uniqueObject = unique[name];
uniqueArray.push(uniqueObject);
}