A function that captures and retains access to variables from its surrounding scope even after that scope has finished executing. This allows the function to 'remember' and use those variables later.
From Latin 'clausura' meaning 'a shutting' or 'enclosure'. In programming, the term was coined in the 1960s during lambda calculus research, referring to how a function 'closes over' its environment, capturing variables from outside its immediate scope.
A closure is like a backpack that a function carries with it wherever it goes, containing all the variables it needs from home. Even when the function travels far from where it was created, it still has access to everything in its backpack!
Complete word intelligence in one call. Free tier — 50 lookups/day.