const fetch=require ("node-fetch")
const countriesAPI = 'https://restcountries.eu/rest/v2/all'
fetch(countriesAPI)
.then(response=>response.json())
.then(data=>{
const uniqeLangArray=[];
for(const l of data){
const a=(l["languages"])
for(let lObject of a){
if(uniqeLangArray.indexOf(lObject["name"])==-1){
uniqeLangArray.push(lObject["name"])
}
//console.log(lObject["name"])
}
//console.log(a[0])
}
console.log("total number of languages in the world used as officials:",uniqeLangArray.length)
})