今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Coffee calculations
(upbeat music) - The array reduce method runs a function once for every item in an array and returns a single value. The reduce function is a function that you provide that takes an accumulator value and a current value. The accumulator value is the combined total of all previous callback function runs and the current volume is the current value in the array that we're executing this function on. In this challenge, you'll be using the array reduce function to calculate the total bill from a trip to the coffee shop with your friends. Each person has ordered some number of coffees and you offer to pay the entire bill. Given an array of integers where each value is greater than zero, calculate the total price of all coffees. Each coffee costs $1.25. You should return your answer in the following format. The total bill is followed by the total. You should use template literals for your return value. Template literals…
内容
-
-
-
Available books6 分钟 11 秒
-
(已锁定)
Movie object5 分钟 29 秒
-
(已锁定)
Vegetarian dinner3 分钟 11 秒
-
(已锁定)
Technical books2 分钟 33 秒
-
(已锁定)
Private object2 分钟 13 秒
-
(已锁定)
Ticking time2 分钟 17 秒
-
(已锁定)
Classroom attendance3 分钟 14 秒
-
(已锁定)
Dynamic colors4 分钟 15 秒
-
(已锁定)
Coffee calculations3 分钟 21 秒
-
(已锁定)
Food truck3 分钟 4 秒
-
(已锁定)
Train generator3 分钟 31 秒
-
(已锁定)
String permutation3 分钟 11 秒
-
(已锁定)
Five friends3 分钟 43 秒
-
(已锁定)
URLify3 分钟 55 秒
-
(已锁定)
Password strength4 分钟 58 秒
-