Ucfirst

Benchmark created on


Preparation HTML

<script>
  var string1 = 'hello world';
  var string2 = 'hello world';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Substr + prototype
String.prototype.toUpperCase.call( string1[ 0 ] ) + string1.substr( 1 );
ready
Substr + substr
string2.substr(0,1).toUpperCase() + string2.substr(1);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.