Created
September 29, 2016 19:54
-
-
Save tomtobac/a02648e5a502bfc36b247dc55e12382f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch(`https://restcountries.eu/rest/v1/all`) | |
.then((res) => { | |
return res.json() | |
}) | |
.then((values) =>{ | |
let array = values | |
.map(x => {return x.currencies[0];}) | |
//.filter((v, i, a) => a.indexOf(v) === i); // filter unique | |
array = Array.from(new Set(array)) // filter ES6 way | |
console.log(array) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment