How do i extract the label in the countryOptions array based on the index on the checkbox?
const checkbox = [1, 2]
export const countryOptions = [
{
label: 'Malaysia',
index: 1,
},
{
label: 'Singapore',
index: 2,
},
{
label: 'Brazil',
index: 3,
},
]
Example output:
const country = ['Malaysia', 'Singapore']