Convert Several Arrays to multidimensional Array - Javascript Array Operation

Javascript examples for Array Operation:Multi Dimensional Array

Description

Convert Several Arrays to multidimensional 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  ww  w  .  j  av  a  2  s . co  m
var array1 = ["value1a1", "value2a1", "value3a1"];
var array2 = ["value1a2", "value2a2", "value3a2"];
var array3 = ["value1a3", "value2a3", "value3a3"];
var multiArray = [array1, array2, array3];
result.innerHTML = JSON.stringify(multiArray, null, 2);
    }

      </script> 
   </head> 
   <body> 
      <pre id="result"></pre>  
   </body>
</html>

Related Tutorials