DEV Community

Discussion on: Daily Challenge #56 - Coffee Shop

Collapse
 
yas46 profile image
Yasser Beyer
const coffeeAmounts = {
    'Americano': 2.20,
    'Latte': 2.30,
    'Flat White': 2.40,
    'Filter': 3.50
}

const coffee = (coffeeType, cash) => {
    return coffeeAmounts[coffeeType] === cash 
      ? "Here is your " + coffeeType + ", have a nice day!"
      : "Sorry, exact change only, try again tomorrow!";
}