News for hackers. Stuff that matters.
Re:Using ‘switch’ to match arbitrary logic instead of string... by masklinn on Monday August 19, 2019 @07:01AM (#20736714)
Seems like an unnecessary mess when you could just use ternary expressions:

    return twitterUrl ? config.twitter
         : githubUrl ? config.github
         : default
Re:Using ‘switch’ to match arbitrary logic instead of string... by Y-bar on Monday August 19, 2019 @07:48AM (#20736914)
I envy you, I’d love to grok ternary expressions better but every time I just end up having to spend a long time unrolling the logic.