Try/Catch Error Perf (v58)

Revision 58 of this benchmark created on


Setup

var undef;

Test runner

Ready to run.

Testing in
TestOps/sec
Try Catch
try {
     return undef.prop;
} catch (ex) {
     return null;
}
ready
If Check
if (undef !== undefined) {
      return undef.prop;
} else {
      return null;
}
ready
Logic Testing
return (undef && undef.prop) || null;
ready
Conditional Operator
return undef?undef.prop:null;
ready

Revisions

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