Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array of strings | Some vs Includes
(version: 1)
Comparing performance of:
Some vs Includes
Created:
8 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
// Preparation: create an array of 10 string values const values = [ "alpha", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliet" ]; // Function to pick a random string from the array function getRandomValue() { const index = Math.floor(Math.random() * values.length); return values[index]; }
Tests:
Some
const target = getRandomValue(); const found = values.some(v => v === target);
Includes
const target = getRandomValue(); const found = values.includes(target);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Some
Includes
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0
Browser/OS:
Chrome 141 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Some
8551404.0 Ops/sec
Includes
7904846.5 Ops/sec
Related benchmarks:
Text.data vs Text.nodeValue
Stor info in Array vs Object
toString vs template literals + array of random strings
Split vs Spread (randomized)
generateRandomString
String character looping
Measure speed
endsWith vs at vs trimEnd vs Regex
Array of strings | Some vs Includes (+ spread)
Comments
Confirm delete:
Do you really want to delete benchmark?