Test name | Executions per second |
---|---|
Set from array | 1399647.9 Ops/sec |
Filter | 1801104.0 Ops/sec |
var array = Array.from({length: 40}, () => Math.floor(Math.random() * 140));
const a = new Set(array)
const filterUnique = (value, index, array) => array.indexOf(value) === index;
const b = array.filter(filterUnique)