Functions
You can make a simple function block with brace brackets.
When a function is expected, you can leave off the brackets.
Parameters
The =>
operator gives a function some parameters.
You can leave off the brace brackets and return
for single-line functions.
The ->
operator does the same thing, but the function won't return anything when called.
Calling
To call a function... put an array of arguments after it.
If a function takes no arguments, you can call it with an empty array.
Alternatively, you can use the :
operator to place the first argument in front of the block.
Last updated
Was this helpful?