Function returned for another Function - Javascript Function

Javascript examples for Function:Function Nest

Description

Function returned for another 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  www .j  a  v  a 2  s  . c om*/
    function returningFn(returnInfo) {
        function otherFn() {
            var value = 123;
            return value;  //return the value
        }
        return otherFn(); 
    }
    console.log( returningFn() );
    }

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

Related Tutorials