Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
indexOfvsstartsWith
(version: 0)
Comparing performance of:
indexOf vs startsWith
Created:
4 years ago
by:
Guest
Jump to the latest result
Tests:
indexOf
const str = Math.random() < 0.5 ? "hey" : "hoi"; "heyhowareyou".indexOf(str) === 0;
startsWith
const str = Math.random() < 0.5 ? "hey" : "hoi"; "heyhowareyou".startsWith(str);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
indexOf
startsWith
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
index vs lastindexof startsWith
IndexOf performance
indexOf vs startsWith for markers
startsWith vs indexOf vs endsWith
findIndex vs indexOf vs contains
Comments
Confirm delete:
Do you really want to delete benchmark?