Generating object keys inside a loop and pushing an array of objects into each one of them? - Javascript Array Operation

Javascript examples for Array Operation:Array of Object

Description

Generating object keys inside a loop and pushing an array of objects into each one of them?

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.j a  va 2  s  .c o  m*/
var marker_container = new Object();
marker_container['MyID'] = new Array();
marker_container['MyID'].push('some value');
marker_container['MyID'].push('some other value');
console.log(marker_container.MyID);
    }

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

Related Tutorials