JavaScript, Technology, Programming, Coding, Tutorial.
a function retains references to variables outside its scope, it can prevent the garbage collector from reclaiming memory. function createClosure() { let data = "Sensitive information"; return function() { console.log(data); }; } const leakyFunction = createClosure(); // The 'leakyFunction' retains