Nullish coalescing vs logical OR (v2)

Revision 2 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
logical OR
var a = undefined || 5;
ready
Nullish coalescing
var a = undefined !== null && undefined !== void 0 ? undefined : 5;
ready
Nullish coalescing with variable
var b = undefined
var a = b !== null && b !== void 0 ? undefined : 5;
ready
logical OR with variable
var b = undefined
var a = b || 5;
ready

Revisions

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