Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Javascript Closure

function makeFunc() {
  var name = 'Mozilla';
  function displayName() {
    alert(name);
  }
  return displayName;
}

var myFunc = makeFunc();
myFunc();
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Javascript #Closure
ADD COMMENT
Topic
Name
9+5 =