help?> ifelse
search: ifelse
ifelse(condition::Bool, x, y)
Return x if condition is true, otherwise return y. This differs from ? or if in that it is an ordinary function, so
all the arguments are evaluated first. In some cases, using ifelse instead of an if statement can eliminate the
branch in generated code and provide higher performance in tight loops.
Examples
≡≡≡≡≡≡≡≡≡≡
julia> ifelse(1 > 2, 1, 2)
2