Easy
This question is a daily question and will count towards your daily streak.
You need to calculate the total price of items in a shopping cart, applying a 20% discount to each item before summing them up. Which implementation correctly achieves this using JavaScript's reduce method?
1const cart = [2 { name: "Laptop", price: 1000 },3 { name: "Headphones", price: 200 },4 { name: "Keyboard", price: 150 },5];