Skip to content

Commit a60a366

Browse files
authored
add note about try catch
1 parent e908a4a commit a60a366

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

js/red-javascript-style-guide/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ Avoid relying on asi to be consistent and have less edge cases to remember.
489489

490490
### try catch over everything
491491

492-
Use `try catch` on individual statements that are expected to fail. Generally avoid `try catch` entirely if possible.
492+
Use `try catch` on individual statements that are expected to fail for code clarity it makes it obvious which one is expected to fail. Generally avoid `try catch` entirely if possible. Validate input as early as possible to avoid potential error management in the middle of the function body.
493493

494494
### try catch finally
495495

0 commit comments

Comments
 (0)