blob: b2de5ac5a25c220deda901037874471646cf8b45 [file] [log] [blame] [view] [edit]
Functions are declared using the `fn` keyword. Its arguments are type
annotated, just like variables; and, if the function returns a value, the
return type must be specified after an arrow `->`.
The final expression in the function will be used as return value.
Alternatively, the `return` statement can be used to return a value earlier
from within the function, even from inside loops or ifs.
Let's rewrite fizzbuzz using functions!
{fn.play}