Thursday, September 10, 2020

Selecting distinct values from a JSON

 

eData is the JSON array

var items = eData.map((d)=> {return d.year})

var uniq = items.filter(GetUnique)


function GetUnique(value, index, self) { 
    return self.indexOf(value) === index;
}