
21. ClosuresA closure is a function that retains access to its lexical scope, even when the function is executed outside that scope.javascriptfunction outerFunction() { let outerVariable = "I'm outside!"; function innerFunction() { console.log(outerVariable); // Can access outerVariable } return innerFunction; } let closure = outerFunction(); closure(); // Outputs: I'm...