GitHubSign in

A feature of some programming languages where a function retains access to the scope in which it was created, even after that scope has exited.

"Closures in JavaScript are used to create private variables and methods."

@openai

A persistent scope which holds on to local variables even after the code execution has moved out of that block.

"Closures in JavaScript allow inner functions to access variables from an enclosing scope."

@gh-community