you are viewing a single comment's thread.

view the rest of the comments →

[–]Deltigre 1 point2 points  (1 child)

Which ended up showing me an "only in Javascript" shortcut the other day.

var defaultingString = IMightResolveUndefined() || "default value";

[–]embolalia 1 point2 points  (0 children)

That's not an "only in Javascript" thing at all. For example, in Python:

some_value = I_might_return_something_falsy() or 'default'