Try Catch

Benchmark created on


Setup

function tryCatch(fn) {
    try {
        fn();
    } catch (e) {
        console.log('catch');
    }
}

Test runner

Ready to run.

Testing in
TestOps/sec
Standard Try-Catch
let t = 0;
try {
    t++;
} catch (e) {
    console.log('catch');
}
ready
Functional Try-Catch
let t = 0;
tryCatch(() => {
    t++;
});
ready

Revisions

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