Y
Hacker News
new
|
ask
|
show
|
jobs
by
ericcholis
3994 days ago
If || is too ugly use the ternary operator, it's inline and only slightly more verbose. That being said, I think using || is a nice pattern for readability.
1 comments
a3n
3994 days ago
And what about the article's argument about passing in 0, which is falsey?
link
vilmosi
3994 days ago
Just be careful. It's worth it at the end of the day.
Honestly, 0 sounds like a default value in most cases anyway.
link