In programming, a closure is a function that has access to its own scope, the scope in which it was created, and the global scope. This allows the function to remember and access variables from outside its immediate lexical scope even after the outer function has finished executing.