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

Revision 77 of this benchmark created on


Preparation HTML

is

Setup

var a = 1, b = true, c = "c", d = [], e = {}, u;
    function isUndefined(value) {return typeof value === 'undefined';}
    function isEqUndefined(value) {return value === undefined;}

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
!!b
!!c
!!d
!!e
ready
withFunciton
isUndefined(a);
isUndefined(b);
isUndefined(c);
isUndefined(d);
isUndefined(e);
ready
with faster function
isEqUndefined(a);
isEqUndefined(b);
isEqUndefined(c);
isEqUndefined(d);
isEqUndefined(e);
ready

Revisions

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