all vals are equal check

Benchmark created on


Setup

const arr = [];
for(let i=0;i< 10000; i++) {
	arr.push(Math.random().toString())
}

Test runner

Ready to run.

Testing in
TestOps/sec
every
console.log(arr.every((it,i,a) => it === a[0]))
ready
set
console.log(Array.from(new Set(arr)).length)
ready

Revisions

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