Parse string to array - Javascript Array Operation

Javascript examples for Array Operation:Array Convert

Description

Parse string to 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  .  ja  va 2s.co m*/
var array_1 = ["string 1",["string 2","string 3"],"string 4"];
var array_2 = [["string 5","string 6","string 7"],"string 8"];
console.log(array_1[1][0]);
console.log(array_2[0][2]);
    }

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

Related Tutorials