functiongetCoffee(change){constchangeSum=change.reduce((a,b)=>a+b);switch(changeSum){case(2.20):return("Here is your Americano, have a nice day!");break;case(2.30):return("Here is your Latte, have a nice day!");break;case(2.40):return("Here is your Flat white, have a nice day!");break;case(3.50):return("Here is your Filter, have a nice day!");break;default:return("Sorry, exact change only, try again tomorrow!");}}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here's mine: