Answers for "js closure functions"

1

closure in javascript

-->closure in javascript
//closure is the combination of function and the lexical enviornment in
//which the function is defined.closure give you access to the functions
//and variables outside the function.
function outer(){
  const outerData ="outer";
  function inner(){
    const innerData="inner";
    console.log(`${outerData} and{innerData}`);
  }
  inner();
}
outer();
Posted by: Guest on December-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language