News for hackers. Stuff that matters.
Re:Using the switch(true) pattern in JavaScript by tpoacher on Monday April 12, 2021 @03:49PM (#26784249)
> Worth noting that elses don't require curly braces

True. I still think the first is clearer though. Either all tests pass, or they don't.

Re:Using the switch(true) pattern in JavaScript by tpoacher on Monday April 12, 2021 @03:50PM (#26784257)
(also I'd be very skeptical of such an if..else ladder. Prime target for bugs.)