The most common conditional in Julia is the if...else expression. For instance, below we implement the Euclidean algorithm for computing the greatest common divisor, using a conditional to handle the base case:
mygcd(a, b) = if a == 0
abs(b)
else
mygcd(b % a, a)
end
The if...else for...