How to get the variable numbers for a julia function

You can do something like this:

julia> function f(args...)
           return length(args)
       end
f (generic function with 1 method)

julia> f(1,2,3)
3
3 Likes