AI

Calculate a single value from an array with .reduce()! It accumulates a result as it loops.

Your Task:

  • Calculate total price of all items
  • Use .reduce() with an initial value of 0
  • Add item.price * item.quantity to the accumulator
TypeScript Solution
Loading...

Submit your code to see test results