[Solved] How to write one line and nested ‘if’ statement without ‘?:’ (is it possible?)
You already used the two important words that are key to undestand why what you intend is not possible, but you probably haven’t grasped their full meaning: Statement and expression. The if statement (like all statements) does not yield a value, while the ?: operator is an expression that does yield a value. Distinguishing between … Read more