Single-line function
Short, single-expression functions.
Syntax
name(params) = expression
Description
Short functions are written in a single line as f(x) = expression. Does the same thing as function...end — just more readable.
Example
Loading editor…
Expected output
17 Hello Julia
When to use?
Short helper functions, mathematical definitions.