closure
A lambda that remembers variables from around it.
A closure is a lambda or local function that captures variables from its enclosing scope; it captures the variable itself, not a snapshot.
Loading interactive…
Examples
int count = 0; Action tick = () => count++;thentick(); tick();leavescountat 2.
See also