Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
startswith vs includes3
(version: 0)
Comparing performance of:
includes vs startsWith vs indexOf starts vs indexOf somewhere
Created:
5 years ago
by:
Guest
Jump to the latest result
Tests:
includes
const str = "https://firebasestorage.googleapis.com/v0/b/a-sketch-a-day-207420.appspot.com/o/" str.includes("firebasestorage")
startsWith
const str = "https://firebasestorage.googleapis.com/v0/b/a-sketch-a-day-207420.appspot.com/o/" str.startsWith("https://fire")
indexOf starts
const str = "https://firebasestorage.googleapis.com/v0/b/a-sketch-a-day-207420.appspot.com/o/" str.indexOf("https://fire") === 0
indexOf somewhere
const str = "https://firebasestorage.googleapis.com/v0/b/a-sketch-a-day-207420.appspot.com/o/" str.indexOf("firebasestorage") > -1
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
includes
startsWith
indexOf starts
indexOf somewhere
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:
javascript startsWith() vs includes()
javascript startsWith() vs includes() for longer string
Js Search - String StartsWith vs Includes
check application json startswith vs includes
startsWith vs includes (when no match)
Comments
Confirm delete:
Do you really want to delete benchmark?