Re:Using the switch(true) pattern in JavaScript
by jimjimjimjim on Monday April 12, 2021 @10:02AM
(#26779562)
I think the beauty of the switch statement is that when you see one you know you're just concentrating on the value of one variable. I think the if else if is actually cleaner for the user example in the post.
[ Parent
| on HN ]
There are no comments on this comment yet.