Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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