Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Capitalize
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
1
135.0M/s
2
126.9M/s
3
39.5M/s
View exact numbers
Test name
Executions per second
✓
1
134,968,528 Ops/sec
2
126,859,192 Ops/sec
3
39,488,408 Ops/sec
Tests:
1
function capitalizeFirstLetter(string) { return string[0].toUpperCase() + string.slice(1); } capitalizeFirstLetter('string');
2
function capitalizeFirstLetter(s) { return s[0].toUpperCase() + s.substr(1); } capitalizeFirstLetter('string');
3
function capitalizeFirstLetter(s) { s.replace(s[0], s[0].toUpperCase()); } capitalizeFirstLetter('string');