Test name | Executions per second |
---|---|
Set spread | 1462627.0 Ops/sec |
Array from set | 999646.1 Ops/sec |
Filter | 539023.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((i,index) => array.indexOf(i)=== index)