Undefined Comparisons

JavaScript performance comparison

Test case created by Jeremy S

Preparation code

<script>
var globalDeclared;
var globalDefined = 0;
var globalFn = function() {};
</script>
    

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
=== undefined
abc === undefined
pending…
typeof == undefined
typeof abc === "undefined"
pending…
void
abc === void 0
pending…
=== undefined (dec)
globalDeclared === undefined
pending…
=== undefined (def)
globalDefined === undefined
pending…
=== undefined (fn)
globalFn === undefined
pending…
typeof == undefined (dec)
typeof globalDeclared === "undefined"
pending…
typeof == undefined (def)
typeof globalDefined === "undefined"
pending…
typeof == undefined (fn)
typeof globalFn === "undefined"
pending…
void (dec)
globalDeclared === void 0
pending…
void (def)
globalDefined === void 0
pending…
void (fn)
globalFn === void 0
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