Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
first upper case
(version: 1)
Compares slice, substr and substring to each other when there is only a start index
Comparing performance of:
slice vs substr vs substring
Created:
8 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
const example = 'there is no spoon'
Tests:
slice
const firstUpper = (string_)=>(string_.charAt(0).toUpperCase() + string_.slice(1)); const result = firstUpper(example);
substr
const firstUpper = (string_)=>(string_.charAt(0).toUpperCase() + string_.substr(1)); const result = firstUpper(example);
substring
const firstUpper = (string_)=>(string_.charAt(0).toUpperCase() + string_.substring(1)); const result = firstUpper(example);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
slice
substr
substring
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!
Comments
Confirm delete:
Do you really want to delete benchmark?