What is the most efficient method for eliminating duplicate entries?
0: { taxType: 9, taxCode: "a", taxValidFrom: "01 Jan 2020 00:00:00.000", taxDesc: "a", …}
1: { taxType: 9, taxCode: "C", taxValidFrom: "03 Jan 2020 00:00:00.000", taxDesc: "C", …}
2: { taxType: 9, taxCode: "a", taxValidFrom: "04 Jan 2020 00:00:00.000", taxDesc: "a", …}
3: { taxType: 9, taxCode: "C", taxValidFrom: "05 Jan 2020 00:00:00.000", taxDesc: "C", …}
4: { taxType: 9, taxCode: "B", taxValidFrom: "06 Jan 2020 00:00:00.000", taxDesc: "B", …}
I aim to create an array that contains unique entries based on both date and tax code.
If the tax code is C, only the entry with the date "05 Jan 2020 00:00:00.000" should remain, as this is closest to today's date (06/01/2020).