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

Revision 38 of this benchmark created by r on


Setup

bob = { a: 1, b: true, c: "c", d: [], e: {} };

Test runner

Ready to run.

Testing in
TestOps/sec
typeof undefined
typeof bob.a === 'undefined';
typeof bob.b === 'undefined';
typeof bob.c === 'undefined';
typeof bob.d === 'undefined';
typeof bob.e === 'undefined';
ready
=== undefined
bob.a === undefined;
bob.b === undefined;
bob.c === undefined;
bob.d === undefined;
bob.e === undefined;
 
ready
== null
bob.a == null;
bob.b == null;
bob.c == null;
bob.d == null;
bob.u == null;
ready
void 0
bob.a === void 0;
bob.b === void 0;
bob.c === void 0;
bob.d === void 0;
bob.e === void 0;
ready
=== null
bob.a === null;
bob.b === null;
bob.c === null;
bob.d === null;
bob.u === null;
ready

Revisions

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