loading...

re: Daily Challenge #56 - Coffee Shop VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Well, here it is: const pay = (amount) => { const beverage = {2.2:'Americano',2.3:'Latte',2.4:'Flat white',3.5:'Filter'}[amount]; return b...
 

Here is it smaller :)

(a,b={2.2:'Americano',2.3:'Latte',2.4:'Flat white',3.5:'Filter'}[a])=>b?`Here is your ${b}, have a nice day!`:`Sorry, exact change only, try again tomorrow!`
Code of Conduct Report abuse