Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- orders = (product, quantity) => {
- 'use strict'
- const getPrice = (product) => {
- const price = {
- coffee: 1.50,
- water: 1.00,
- coke: 1.40,
- snacks: 2.00
- }
- return price[product]
- }
- console.log((getPrice(product) * quantity).toFixed(2))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement