Skip to content
RED SAG Skills
medium10 pts · first answer countsjavascriptarrays

reduce on an empty array

A cart total is calculated like this. What happens when the cart is empty?

const prices = []
const total = prices.reduce((sum, p) => sum + p)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions