Is anyone can help me to found this output. Sample output:
['milk', 'bread', 'potato']
[20, 15, 10]
Here is the code.
var itemsToBuy = {
milk: {
quantity : 5,
price: 20
},
bread: {
quantity : 2,
price: 15
},
potato: {
quantity : 3,
price: 10
}
}
I have found for first array using Object.keys(itemsToBuy) but not able to found for second array.