Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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();
Source by betterprogramming.pub #
 
PREVIOUS NEXT
Tagged: #closure #javascript
ADD COMMENT
Topic
Name
6+2 =