Skip to content

Glossary: Software Design Patterns

Closure

Also written: inner function

A function defined inside another that remembers the outer function's values after it returns. `percent_off(10)` returns a `discount` function that remembers `pct`.

Where the book teaches it

Related terms

Strategy