How can I return object value based on array value in JavaScript.
Array Object:
const options = [
{ value: 'a', label: 'Apple' },
{ value: 'b', label: 'Boy' },
{ value: 'd', label: 'Boy' },
];
Array:
const status = ['a', 'b', 'c'];
Output expectation:
result = ['Apple', 'Boy']
I tried as below but it gives me a whole object in return
options.filter(option => status.includes(option.value))