Call function with arguments in another function - Javascript Function

Javascript examples for Function:Function Argument

Description

Call function with arguments in 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() {/*w w  w  .ja  v  a  2s .c o  m*/
function origin(a, b) {
    nested.apply(this, arguments);
}
function nested (a, b) {
    console.log(a, b);
}
origin('parameter1', 'parameter2');
    });

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

Related Tutorials