Try/Catch Error Perf (v11)

Revision 11 of this benchmark created on


Preparation HTML

<script>

  function tryCatch(x) {
    try {
      return x.prop;
    } catch (ex) {
      return null;
    }
  }

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

Test runner

Ready to run.

Testing in
TestOps/sec
Try Catch
var x = {prop: 3};
tryCatch(x);
ready
If Check
var x = {prop: 3};
ifCheck(x);
ready

Revisions

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