This question looks like OP is worried about DRY and perhaps readability of a one-liner ternary.
I have a bias against one-liners and other narrowed-down questions, but there's a consensus about them being reviewable and on-topic, and besides there's no "too narrow" close reason.
Regardless of my own bias against one-liners, the question feels, and prompts answers that are, Stack Overflow -ish. I don't think that question (and even its accepted answer) contribute to the overall site's content quality.
But I'm at a loss with finding an appropriate reason to close it. Would "unclear what you're asking" be appropriate in this case?