Push one array to another array - Javascript Array Operation

Javascript examples for Array Operation:Multi Dimensional Array

Description

Push one array to another array

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 w w  .j  av a2  s .  c o m*/
      var arr = [];
      var temp = { "name": "me" };
      arr.push(temp)
      console.log(arr)
      setTimeout(function(){
          temp["name"] = "you";
          arr.push(temp)
          console.log(arr)
          }, 3000);
    });

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

Related Tutorials