Test name | Executions per second |
---|---|
using Set | 664.2 Ops/sec |
using filter | 597.2 Ops/sec |
var testArray = Array.from(Array(100000)).map(i => Math.floor(Math.random() * 10))
Array.from(new Set(testArray))
testArray.filter((v, i, a) => a.indexOf(v) === i)