x = bar()
if val {
x = foo()
}
Is both shorter and functionally more equivalent with the ternary example. x = bar()
if val {
x = foo()
}
Is both shorter and functionally more equivalent with the ternary example.I'd still rather a ternary over any of the above options though!