I have an array with duplicates values. I need to remove duplicates out of it
this.list1 = [
{ item_id: 1, item_text: 'Maintenance' },
{ item_id: 2, item_text: 'Raw Material Plates and Profile' },
{ item_id: 3, item_text: 'Raw Material Plates and Profile' },
{ item_id: 4, item_text: 'Asset' },
{ item_id: 5, item_text: 'Asset' },
.
.
.
]
after removing duplicates,
this.list1 = [
{ item_id: 1, item_text: 'Maintenance' },
{ item_id: 2, item_text: 'Raw Material Plates and Profile' },
{ item_id: 3, item_text: 'Asset' },
.
.
.
]
And also item_id should be in order after removing duplicates. How to do this in proper way?