void vs undefined (v12)

Revision 12 of this benchmark created by Kyle A. Matheny on


Test runner

Ready to run.

Testing in
TestOps/sec
undefined
(function(a) {
 return (a === undefined);
})();
ready
void
(function(a) {
 return (a === void 0);
})();
ready
void2
function b(a) {
 return (a === void 0);
};

b();
ready
typeof
function b(v) {
 return "undefined" === typeof(v);
}

b();
ready
typeof 2
(function(v) {
 return "undefined" === typeof(v);
})();
ready
undefined 2
function b(a) {
 return (a === undefined);
};

b();
ready

Revisions

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