Accessing the variable inside function - Javascript Function

Javascript examples for Function:Function Definition

Description

Accessing the variable inside function

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*from   w  ww.  j a va2s  .c o m*/
_  = {};
_.Qj = function () {
    function a() {
        return 'foo'
    }
    return {
        er: a
    }
}();
console.log(_.Qj.er())
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials