From 71351fcd918ef9e740f257e5040b4b1b6bae6645 Mon Sep 17 00:00:00 2001 From: ellipticview Date: Sat, 4 May 2024 11:32:00 +0200 Subject: Added example to anonymous functions --- .../chapter1_functions/lesson04_anonymous_functions/en.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/content/chapter1_functions/lesson04_anonymous_functions/en.html') diff --git a/src/content/chapter1_functions/lesson04_anonymous_functions/en.html b/src/content/chapter1_functions/lesson04_anonymous_functions/en.html index 6c6d47d..69606dd 100644 --- a/src/content/chapter1_functions/lesson04_anonymous_functions/en.html +++ b/src/content/chapter1_functions/lesson04_anonymous_functions/en.html @@ -1,5 +1,9 @@

- As well as module-level named functions, Gleam has anonymous function - literals, written with the fn() { ... } syntax. + As well as module-level named functions, Gleam has anonymous function + literals, written with the fn() { ... } syntax.

Anonymous functions can be used interchangeably with named functions.

+

+ Anonymous functions can reference variables that were in scope when they + were defined, making them closures. +

-- cgit v1.2.3