I am working with a JavaScript array that looks like this:
{id: 'ZM', name: "Zambia"},
{id: 'MZ', name: "Mozambique"},
{id: 'BW', name: "Botswana"},
{id: 'NA', name: "Namibia"},
{id: 'MW', name: "Malawi"},
{id: 'ZW', name: "Zimbabwe"},
I need to fetch specific array records based on the ids ('BW', 'MW'). How can I achieve this? For example, after fetching, I want the array records to be as follows:
{id: 'BW', name: "Botswana"},
{id: 'MW', name: "Malawi"}