typescript get unique values from array or objects code example
Example 1: javascript find unique values in array of objects
var flags = [], output = [], l = array.length, i;
for( i=0; i<l; i++) {
if( flags[array[i].age]) continue;
flags[array[i].age] = true;
output.push(array[i].age);
}
Example 2: angular 10 get unique values from array of objects
Array.from(new Set(yourArray.map((item: any) => item.name)));