local vs global 2

Benchmark created on


Preparation HTML

<script>
  var text="ZxCvbn";
  var g = '';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
local var
var lowerVersion=text.toLowerCase();
if (lowerVersion=='abcdef' || lowerVersion=='asdfgh' || lowerVersion=='zxcvbn'){
    g = lowerVersion;
}
ready
global var
if (text.toLowerCase()=='abcdef' || text.toLowerCase()=='asdfgh' || text.toLowerCase()=='zxcvbn'){
    g = text;
}
ready

Revisions

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