Try/Catch Error Perf

Benchmark created on


Preparation HTML

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

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

Test runner

Ready to run.

Testing in
TestOps/sec
Try Catch
tryCatch();
ready
If Check
ifCheck();
ready

Revisions

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