Sep 29, 2023
While I agree it is handy to have a default value the case presented here I'd prefer the && operator to the ternary as both would achieve the same result. The ternary is less readable, you also hit the issue where if you need nested ternaries then you're running into the same problems, and probably somethings gone wrong.
I do like the or approach though! that would be handy for welcome messages and other things that require a default value.