Medium

Calculate Shopping Cart Total with Category-Based Discounts using JavaScript Reduce

You’re implementing a shopping cart for an e-commerce platform. You need to calculate the total cost of items while applying a discount to certain categories. Complete the function to correctly calculate the cart total.

Choose an option below