Variable number of object parameters to function - Javascript Function

Javascript examples for Function:Function Argument

Description

Variable number of object parameters to 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  ww w .ja  va2  s  . c o  m*/
function objArgs() {
    for(var i = 0; i < arguments.length; i++){
        console.log(arguments[i]);
    }
}
objArgs({one: 1}, {two: 2}, {three: 3});
    });

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

Related Tutorials