about 9 years ago
Whenever we defined a function within another function, the inner function has accessibility for the variables in the outer function.
Following is the example of closure.
function mainFunction(outerData) { var mainFuncData = 3; function innerFunction(innerFuncData) { console.log(outerData + innerFuncData + (++mainFuncData)); // will alert 16 } innerFunction(10); } mainFunction(7); //17
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)