Calculate cost of basket
Write a function, priceOfBasket, that returns the total cost of a basket of items.
Input will be:
- an object containing keys (items available in the shop) and values (their prices):
{banana: 3, orange: 4, pear: 5, apple: 2}
- an array of strings representing the individual items bought:
['banana', 'orange', 'apple', 'banana', 'orange', 'banana']
Output should be:
- an integer representing the total cost of the individual items bought:
19