1

I'm new to ES6 so please be gentle :D

What I want to do is return array of values that will be used to filter out data. The problem is I have many duplicated values in this array and I need to filter those out. Bellow is working code that display colors. What would be most elegant way to do that? I was thinking somehow chaining filter function but not sure how to achieve it. If you have any suggestion please respond..thanks!

        const colors = data.options[1].product_links
        .map(item => {
            return `
            <div class="user">
                <h1>${item.product_data.color_value}</h1>
            </div>

            `;
        })
  • Also relevant: [Remove duplicates from an array of objects in JavaScript](https://stackoverflow.com/q/2218999) | [JavaScript: Remove duplicates of objects sharing same property value](https://stackoverflow.com/q/32238602) – VLAZ Aug 05 '20 at 07:18
  • How did I not find that!! Thx VLAZ, solved!! – HunterListInsight Aug 05 '20 at 07:29

0 Answers0