JavaScript

Closure (JavaScript)

A function plus the lexical environment it captured.

Why interviewers ask about it

Behind private state, memoisation and the classic var-in-a-loop bug where every callback shares one binding. let creates a fresh binding per iteration.

This term is part of the free Python Full-Stack interview preparation module - browse the full glossary for every definition.