4 ms·
Seems like an unnecessary mess when you could just use ternary expressions: return twitterUrl ? config.twitter : githubUrl ? config.github
by masklinn 7y ago
Seems like an unnecessary mess when you could just use ternary expressions:
return twitterUrl ? config.twitter
: githubUrl ? config.github
: default
- Y-bar 7y agoI 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.