outer-scope variable

noun
UK /ˈaʊtə skəʊp ˈveəriəbl/
US /ˈaʊtər skoʊp ˈveriəbl/

A variable that lives outside a small block of code, so the code inside can still see and use it.

The function could read the outer-scope variable because it was declared before the function started.


OTHER MEANINGS

2. A variable declared in a surrounding block that an inner block can access.

Inside the loop, the outer-scope variable kept its value between iterations.

3. A name resolved from an enclosing function rather than the current one.

The inner function changed the outer-scope variable instead of making a new one.

4. A variable that is visible to nested code but not created by it.

She renamed the outer-scope variable to make the closure easier to read.