function squared(x)
x .^ 2
endsquared (generic function with 1 method)
Define new functions with function:
function squared(x)
x .^ 2
endsquared (generic function with 1 method)
squared(3)9
Optionally define types using ::Type:
function squared(x::Float64)
x .^2
endsquared (generic function with 2 methods)
squared(3)9