JavaScript, Technology, Programming, Coding, Tutorial.
references to variables. function createClosure() { let data = "Sensitive information"; return function() { console.log(data); }; } // Instead, pass parameters directly to the inner function function createClosureFixed() { let data = "Sensitive information"; return function() { console.log(data);