The line above uses broadcasting to compare a to each of the listed numbers. As a result, the argument of any is a vector of Bool values, and any returns true if the argument collection contains any true.
This is probably the most straightforward way, but not the most efficient.
Another way is to use
any(==(a), [1,2,3,4])
# or equivalently
any([1,2,3,4]) do x
x == a
end
which does the same thing but avoids creating the intermediate vector of Bools.
EDIT: Haha, @lmiq’s suggestion is definitely better if you are interested in equality comparison. Use any when the condition is not equality.