Try/Catch Error Perf (v16)

Revision 16 of this benchmark created by unfo- on


Preparation HTML

<script>
  function tryCatch(undef) {
    try {
      return undef.prop;
    } catch (ex) {
      return null;
    }
  }

  function ifCheck(undef) {
    if (undef !== undefined && undef.prop != undefined) {
      return undef.prop;
    } else {
      return null;
    }
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Try Catch
tryCatch({'prop':1});
ready
If Check
ifCheck({'prop':1});
ready

Revisions

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