=== vs == for `undefined1

Benchmark created by Mike McCaughan on


Preparation HTML

<script>
  var a, b;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
=== for undefined
if (a === undefined) {
 var c = '';
}
ready
== for undefined
if (b == undefined) {
 var d = '';
}
ready
typeof with === for undefined
if (typeof a === 'undefined') {
 var e = '';
}
ready
typeof with == for undefined
if (typeof b == 'undefined') {
 var f = '';
}
ready

Revisions

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

  • Revision 1: published by Mike McCaughan on
  • Revision 2: published by Mike McCaughan on
  • Revision 3: published by Mike McCaughan on
  • Revision 4: published by Mike McCaughan on