aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter1_functions/lesson04_anonymous_functions/en.html
blob: 93e11a9dfb1135800c57a81313f8719b7f886bb7 (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>