Test name | Executions per second |
---|---|
Set spread | 1249117.0 Ops/sec |
Array from set | 1112046.4 Ops/sec |
Filter | 2071185.8 Ops/sec |
var array = Array.from({length: 20}, () => Math.floor(Math.random() * 140));
const f = [ new Set(array)]
const l = Array.from(new Set(array))
const b = array.filter((i,index,a) => a.indexOf(i) === index)