Re:Using the switch(true) pattern in JavaScript
by btown on Monday April 12, 2021 @11:27AM
(#26780443)
I agree; `if (` is much more well-known and "grokkable" to engineers at practically any level than `case` - and exactly the same number of characters. There's no need to bring a sledgehammer when the nail is perfectly handled by a normal hammer.
[ Parent
| on HN ]