const total = carts.reduce((a, b) => a + b.subtotal, 0);