Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Some vs. Every Includes
Check if NOT some members of an array equal a value vs. checking if all values in an array aren't equal to a value.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Some (Non-Existing Value)
31870724.0 Ops/sec
Every (Non-Existing Value)
31624466.0 Ops/sec
Some (Existing Value)
33635356.0 Ops/sec
Every (Existing Value)
33064758.0 Ops/sec
Script Preparation code:
var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
Tests:
Some (Non-Existing Value)
!array.some(value => value === 20);
Every (Non-Existing Value)
array.every(value => value !== 20);
Some (Existing Value)
!array.some(value => value === 10);
Every (Existing Value)
array.every(value => value !== 10);