omitted parameters

JavaScript performance comparison

Test case created by qwerty

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    function thetest(someVar, someBool) {
        if (someBool) {
            return someVar + 10;
        }
        else {
            return someVar + 11;
        }
    }
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
omitted
thetest(1);
pending…
explicitly undefined
thetest(1, undefined);
pending…
boolean
thetest(1, false);
pending…
number
thetest(1, 0);
pending…
null
thetest(1, null);
pending…
empty string
thetest(1, '');
pending…

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

Compare results of other browsers

0 comments

Add a comment