Removing duplicates

Benchmark created on


Setup

let array = [];
for (let i = 0; i < 100000; i++) {
	array.push(i % 1234)
}

Test runner

Ready to run.

Testing in
TestOps/sec
Filter indexof
array.filter((item, index) => array.indexOf(item) === index)
ready
Array from set
Array.from(new Set(array))
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.