Skip to content

Commit

Permalink
Update try-catch.md
Browse files Browse the repository at this point in the history
  • Loading branch information
miparnisari committed Nov 14, 2016
1 parent 18b09b9 commit 1c0e3f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions error/try-catch.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Certain constructs like `try/catch` are considered not optimizable by the JavaScript engine, so avoid handling business logic inside.

Just pass an error handler as a callback for this type of things.
Instead, just pass an error handler as a callback for this type of things.

Or maybe the thing that you need to avoid is synchronous code? :P

A good approach for supporting optimization with throweable code is to return an `Error` and later and check the type.
A good approach for allowing optimization with throwable code is to return an `Error` and later check the type of the returned object.

```js
function maybeError () {
Expand Down

0 comments on commit 1c0e3f7

Please sign in to comment.