News for hackers. Stuff that matters.
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.
Re:Using the switch(true) pattern in JavaScript by layer8 on Monday April 12, 2021 @11:48AM (#26780760)
I agree, but the problem presumably is the “else”.