Let's imagine we have an object as follows:
data = {
Apple: 5,
Banana: 8,
Orange: 12,
Mango: 3
}
If I wanted to retrieve the values corresponding to an array of keys using vanilla JavaScript or jQuery, how could I accomplish this? For example:
var keys = ["Banana", "Mango"]
Object.values(data)[keys]
The desired output would be an array containing the values [8, 3]