i wrote a function that will throw an ArgumentError if it occurred any exception.
but i have a question about throwing an error:
i can use throw()
directly, also i can use the return
keyword.
Is there any difference?
function distance(a, b)
if length(a) != length(b)
return throw(ArgumentError(""))
end
dist = 0
i = 1
while i <= length(a)
if a[i] != b[i]
dist += 1
end
i += 1
end
return dist
end