I have an array as follows -
const options = [{text:'A', _id: '5trgh'}, {text:'B', _id: '5vjds'}, {text:'C', _id: '5njkn'}];
I want to extract the value of text based on _id. If I have just one _id, I can do it easily using filter as below -
const filteredText = options.filter(k => k._id == '5trgh'); // outputs A
I want to know what if I have multiple id's at once like 5trgh & 5vjds and I want to output A & B with filtered text.