"Type of undefined" vs "=== undefined" (v72)

Revision 72 of this benchmark created on


Preparation HTML

<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js"></script>

Setup

var a = 1,
      b = true,
      c = "c",
      d = [],
      e = {}, u;

Test runner

Ready to run.

Testing in
TestOps/sec
typeof undefined
typeof a === 'undefined';
typeof b === 'undefined';
typeof c === 'undefined';
typeof d === 'undefined';
typeof e === 'undefined';
ready
=== undefined
a === undefined;
b === undefined;
c === undefined;
d === undefined;
e === undefined;
ready
=== undefined(local)
a === u;
b === u;
c === u;
d === u;
e === u;
ready
void 0
a === void 0;
b === void 0;
c === void 0;
d === void 0;
e === void 0;
ready
Lodash
_.isUndefined(a);
_.isUndefined(b)
_.isUndefined(c);
_.isUndefined(d);
_.isUndefined(e);
ready

Revisions

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