Similar question but with javascript here. Accepted answer
const data = [
{ group: 'A', name: 'SD' },
{ group: 'B', name: 'FI' },
{ group: 'A', name: 'MM' },
{ group: 'B', name: 'CO'}
];
const unique = [...new Set(data.map(item => item.group))]; // [ 'A', 'B']
However if you try the same thing with typescript you get an error ts2802 Type 'Set' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher
How can you achieve the same results with typescript?
Question two How about you want to get unique objects rather than strings . For eample if you want to get
[
{ group: 'A', name: 'SD' },
{ group: 'B', name: 'FI' },
]