Medium
How to Extract Unique Tags from Array of Objects Using JavaScript Reduce Method
You need to extract all unique tags from an array of posts using JavaScript's reduce method. Which approach will correctly gather unique tags into an array?
1const posts = [2 { id: 1, tags: ["javascript", "coding"] },3 { id: 2, tags: ["coding", "web"] },4 { id: 3, tags: ["javascript", "web", "frontend"] },5];