typeof v null

Benchmark created by Izzy on


Preparation HTML

<script>
  var myDeclaredObj = {
     imhere: 12
  };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Global typeof
typeof myNonDeclaredVar == "undefined"
ready
Global == null
window["myNonDeclaredVar"] == null
ready
Subobj typeof hit
typeof myDeclaredObj.nothere == "undefined"
ready
Subobj null hit
myDeclaredObj.nothere == null
ready
Subobj typeof miss
typeof myDeclaredObj.imhere == "undefined"
ready
Subobj null miss
myDeclaredObj.imhere == null
ready

Revisions

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