I want to remove completely an item from the list, below is the list
var list = [{id: 1, match_number: 1, name: "match1"},
{id: 2, match_number: 2, name: "match2"},
{id: 3, match_number: 3, name: "match3"},
{id: 4, match_number: 4, name: "match4"},
{id: 5, match_number: 5, name: "match5"}]
I want remove match_number completely from the list, and want to achieve like
var list = [{id: 1, name: "match1"},
{id: 2, name: "match2"},
{id: 3, name: "match3"},
{id: 4, name: "match4"},
{id: 5, name: "match5"}]
Below is the code where I achieved the result for single item, but I have an array where key are given like ['match_number','id']. on the basis of this I want to remove item from the main list.
How can I solve this?
//code for single item
var listitem = list.map((i) => {
const {match_number,...item} = i;
return item;
});