Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

closure

function add(a) {
     return function(b) {
         return a + b;
     };
 }

 let addTen = add(10);
 let addSeven = addTen(7);

 console.log(addSeven); // 17
Source by shahansdiary.com #
 
PREVIOUS NEXT
Tagged: #closure
ADD COMMENT
Topic
Name
4+5 =