Functions
A function defines a mapping from an input value to an output value.
Syntactically, a function requires the following elements:
func
keywordFunction name (all lower case)
In parentheses, one or more arguments
->
mapping operatorOutput type
In braces, code block of body
Terminating
;
Methods in class
definitions are similar to functions, but must occur inside a class
code block and do not have a prefatory func
keyword.
Last updated