Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Closure ====== "A closure is the combination of a **function** and the **lexical environment** within which that function was declared." https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures Example <code> function makeFunc() { var name = 'Mozilla'; function displayName() { alert(name); } return displayName; } var myFunc = makeFunc(); myFunc(); </code> DisplayName maintains a reference to its lexical environment. programming_languages/js/closure.txt Last modified: 2019/06/19 10:44by phreazer