Y
Hacker News
new
|
ask
|
show
|
jobs
by
notyourday
1888 days ago
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.
2 comments
dfee
1888 days ago
This will prevent the JR dev from making that mistake:
https://eslint.org/docs/rules/no-fallthrough
link
BiteCode_dev
1888 days ago
That's what tests are for.
link