JavaScript Interview Question: What Is a Closure?
Short answer: a closure is a function together with the variables from the scope where it was created. The function keeps access to those variables even after the outer function has returned. function makeCounter() { let count = 0; // captured by the inner fun...