aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter1_functions/lesson04_anonymous_functions/en.html
blob: 69606dde11928effe0525b4d84ff6872a8c70b1a (plain)
1
2
3
4
5
6
7
8
9
<p>
    As well as module-level named functions, Gleam has anonymous function
    literals, written with the <code>fn() { ... }</code> syntax.
</p>
<p>Anonymous functions can be used interchangeably with named functions.</p>
<p>
    Anonymous functions can reference variables that were in scope when they
    were defined, making them <em>closures</em>.
</p>