Test name | Executions per second |
---|---|
Set spread | 1575218.9 Ops/sec |
Array from set | 1335953.5 Ops/sec |
Filter | 509903.6 Ops/sec |
var array = Array.from({length: 40}, () => ({ value: Math.floor(Math.random() * 140)}));
const values = array.map(({ value }) => value)
const f = [ new Set(values)]
const values = array.map(({ value }) => value)
const s = new Set(array)
const l = Array.from(s)
const b = array.filter((item,index) => array.indexOf(item.value)=== index)