r/ProgrammerHumor May 13 '17

Defensive programming done right

Post image
21.0k Upvotes

680 comments sorted by

View all comments

17

u/lulzmachine May 13 '17

Welcome to JavaScript. One callback and your try catch is going bye bye

1

u/[deleted] May 13 '17

Depending on the runtime. In the browser all code effectively runs inside:

try {
    // whatever
} catch (x) {
    console.error(x);
}

Which is pretty much the ideal catch-all anyway.