Answers for "What is a closure in JavaScript?"

4

closure in javascript

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

var myFunc = makeFunc();
myFunc();
Posted by: Guest on July-04-2020

Code answers related to "What is a closure in JavaScript?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language