Here is an example for you to consider:
inventory = {'Apple':2, 'Orange' :1 , 'Mango' : 2}
In this inventory, both Apple and Mango have the maximum quantity. How can I create a function that returns both Apple and Mango as the answer?
I attempted something like this :
Object.keys(inventory).filter(function(item) { return inventory[item] === Math.max(...Object.values(inventory)); });
However, this only gives one result which is Apple.