Testing Null-type Speed Performance Comparison

Benchmark created by Krinkle on


Description

See also:

  • "Testing Undefined" (current)
  • "Testing Null"
  • "Testing Null or undefined"

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
  (function(a) {
   window.foo = a;
  })();
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Typeof
typeof foo === 'undefined';
ready
jQuery.type
$.type(foo) === 'undefined';
ready
Strict comparison to undefined
foo === undefined;
ready

Revisions

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