Scope and closures
Every function has a scope of variables that are only accessible within that function. A closure is a function that has access to the variables from its surrounding scope, even after the surrounding function has finished executing.
Loading TypeScript...
Closures are commonly used to generate functions that operate on the arguments of the outer function.
Loading TypeScript...