20 ms·
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
by notyourday 6y 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.
- dfee 6y agoThis will prevent the JR dev from making that mistake: https://eslint.org/docs/rules/no-fallthrough https://eslint.org/docs/rules/no-fallthrough
- BiteCode_dev 6y agoThat's what tests are for.