Skip to content

Glossary: Go Beyond the Basics

closure

Also written: closures

A function literal that uses and can change variables from the code around it. `counter()` returns a closure that remembers its own `n`.

Where the book teaches it

Related terms

function literalfunction value