I have a source list of objects of 4 properties with some duplicate values, want to select distinct objects of 2 properties without using a foreach loop.
Source list:
let Students= [
{Id: 1, Name: 'A', Class: 'I', Subject: 'Math'},
{Id: 2, Name: 'B', Class: 'II', Subject: 'Bengali'},
{Id: 1, Name: 'A', Class: 'I', Subject: 'Science'},
{Id: 2, Name: 'B', Class: 'II', Subject: 'English'}
];
I want an output list like:
[
{Id: 1, Name: 'A'},
{Id: 2, Name: 'B'}
]