Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
array find vs some better
Compare the new ES6 spread operator with the traditional concat() method
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0
Browser:
Firefox 133
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
array find
447609.1 Ops/sec
array some
438262.5 Ops/sec
Script Preparation code:
// make large array const randomStringArray = Array.from({ length: 1000 }, () => Math.random().toString(36).substring(7)); randomStringArray.splice(500, 0, "string");
Tests:
array find
const b = randomStringArray.find(item => item === 'string');
array some
const b = randomStringArray.some(item => item === 'string');