If there are side-effects of building either of the values, or if there's other stuff happening that depends on the same conditional, then returning from an if/else would make sense.
Also, situations might come up where it's difficult or opaque to build one of the values in-line. If the values don't already exist as variables, and can't be built in-line, then one'll probably use the if/else format.
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!