/ Published in: JavaScript
When a function is defined in another function and it has access to the outer function's context even after the outer function returns.
Expand |
Embed | Plain Text
function outerFunction(someNum) { var someString = 'milk'; var content = document.getElementById('content'); function innerFunction() { content.innerHTML = someNum + ': ' + someString; content = null; // IE memory leak for DOM reference } innerFunction(); } outerFunction(1);
You need to login to post a comment.
