Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
notyourday
5y ago
0 comments
Save
Share
If you don't have a 'return' there's nothing to say that some time later some junior developer would not modify throw to be something else or forget that throw does not return.
0 comments
2 comments · 2 top-level
top
newest
oldest
dfee
5y ago
This will prevent the JR dev from making that mistake:
https://eslint.org/docs/rules/no-fallthrough
BiteCode_dev
5y ago
That's what tests are for.
j
/
k
navigate · click thread line to collapse