Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
String methods compare 2
(version: 0)
Comparing performance of:
startsWith vs substring vs indexOf vs notequal
Created:
3 years ago
by:
Guest
Jump to the latest result
Tests:
startsWith
const myString = "v-component" myString.startsWith("v-")
substring
const myString = "v-component" myString.substr(0, 2) === "v-"
indexOf
const myString = "v-component" myString.indexOf("v-")
notequal
const myString = "v-component" myString.substr(0, 2) !== "v-"
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
startsWith
substring
indexOf
notequal
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:
char index vs charAt() vs slice() with Object
char index vs charAt() vs slice() for the last character
char index vs charAt() vs slice() vs startsWith()
charAt() vs slice()
char index vs charAt() vs slice() with strict eq
Comments
Confirm delete:
Do you really want to delete benchmark?