loop through each member of each array in another array - Javascript Array Operation

Javascript examples for Array Operation:Array Element

Description

loop through each member of each array in 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() {/*ww  w  .jav  a2 s.c o m*/
n = [ a = ["foo1","bar1"],
      b = ["foo2","my1"],
      c = ["foo3","bar3"],
      d = ["foo4","bar4"],
      e = ["foo5","bar5"] ];
for (var index = 0; index < n.length; index++) {
    var foobar = n[index];
    var foo = foobar[0];
    var bar = foobar[1];
    console.log(foo + bar);
}
    });

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

Related Tutorials