Javascript .toUpperCase() vs .toLowerCase() (v8)

Revision 8 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var allLower = "abcdef";
    var allUpper = "ABCDEF";
    var mixed = "aBcDeF";

Test runner

Ready to run.

Testing in
TestOps/sec
lower to upper
allLower.toUpperCase();
ready
upper to upper
allUpper.toUpperCase();
ready
mixed to upper
mixed.toUpperCase();
ready
lower to lower
allLower.toLowerCase();
ready
upper to lower
allUpper.toLowerCase();
ready
mixed to lower
mixed.toLowerCase();
ready

Revisions

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