function reduceDemo(orders) { | |
const initialQuantity = 0; | |
const totalQuantities = orders.reduce((sum, order) => sum + order.quantity, initialQuantity); | |
console.log(`Total Quantities: ${totalQuantities}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment