Re:Using ‘switch’ to match arbitrary logic instead of string...
by metalgearsolid on Monday August 19, 2019 @06:34AM
(#20736563)
Swift's nil-coalescing operator is a great solution for this.
[ Parent
| on HN ]
Re:Using ‘switch’ to match arbitrary logic instead of string...
by lsaferite on Monday August 19, 2019 @08:32AM
(#20737130)
And you just introduced a bug.
You refactored the code and changed the logic without noticing.
Re:Using ‘switch’ to match arbitrary logic instead of string...
by degif on Monday August 19, 2019 @06:45AM
(#20736635)
The same is in JavaScript:
return (twitterUrl && config.twitter) || (githubUrl && config.github) || default