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 (iPhone; CPU iPhone OS 17_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 17
Operating system:
iOS 17.1.2
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
Some (Non-Existing Value)
29105938.0 Ops/sec
Every (Non-Existing Value)
21280322.0 Ops/sec
Some (Existing Value)
26271694.0 Ops/sec
Every (Existing Value)
22812970.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);