Trying to make a select filter with all the unique coins, but not getting to the end of it correctly.
When looping through data I can get a list of all the coins like this.
const uniqueCoins = data.map((item) => {
item.currencies.map((subItem) =>
console.log(subItem))
});
I also want to use the Set method and spread operator to get just unique values but I’m not sure how to combine all these.
const data = [
{
id: "1",
name: "Digitec",
description: "Wir akzeptieren folgende Kryptowährungen",
currencies: [
{coin: "Bitcoin"},
{coin: "Ethereum"},
{coin: "XRP"},
],
link: "webseite besuchen",
},
{
id: "2",
name: "Galaxus",
description: "Wir akzeptieren folgende Kryptowährungen",
currencies: [
{coin: "Bitcoin"},
{coin: "Monero"},
{coin: "XRP"},
],
link: "webseite besuchen",
},
{
id: "3",
name: "Brack.ch",
description: "Wir akzeptieren folgende Kryptowährungen",
currencies: [
{coin: "Litecoin"},
{coin: "Dogecoin"},
{coin: "XRP"},
],
link: "Onlineshop besuchen",
},
];