Functional Try-Catch (v2)

Revision 2 of this 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.