forked from gitter-badger/js-1
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels