mardi 3 avril 2018

How to pass value from one immediate invoking function (IIFE) to an another invoking function in javascript

Suppose you have two immediate invoking functions - example1 and example2. how to receive a value from example2 to example1? or how to call a method from example2 ?

let example1 = (function(testvalue){

   // Receive value from example2 function.

})(example2);



let example2 = (function(){
       let _testvalue = 12;
       return{
               getvalue : function(){
                     return _testvalue;
                } 
              }

    })();




Aucun commentaire:

Enregistrer un commentaire