I have two functions in a code, one using map() and the other, filter()
const eip = [...new Map(elasticIps.map(e => [e.publicIp, e])).values()];
const eip = elasticIps.filter((v,i,a)=>a.findIndex(t=>(t.publicIp === v.publicIp))===i)
They both do exactly the same thing for me, but I don't know the best way to find out which is faster