I'm using filteredArray
to get unique values for my array. Is there a more concise way of doing this? I'm totally fine with the way it is, but just wanted more perspectives.
I tried new Set(.. but it gave me back the numbers as strings and that's not what I needed. However, I prolly implemented wrong or something.
function myFunction2() {
const toReturn = Object.keys(list).map(key => list[key].idDealer);
var filteredArray = toReturn.filter(function(item, pos){
return toReturn.indexOf(item)== pos;
});
return filteredArray;
}