javascript trying to get 3rd nested array.length and value

Posted by adardesign on Stack Overflow See other posts from Stack Overflow or by adardesign
Published on 2010-03-21T17:49:34Z Indexed on 2010/03/21 17:51 UTC
Read the original article Hit count: 356

How can i get the 3rd nested array (in this case the array starting with "yellow")

the array looks like this:

[
 ["Large", 
   ["yellow", "green", "Blue"],
   ["$55.00", "$55.00", "$55.00"]
 ["Medium",
  ["yellow", "green", "Blue", "Red"],
  ["$55.00", "$55.00", "$55.00", "$55.00"]
 ]
 ["small",
  ["yellow", "green", "Blue", "Red"],
  ["$55.00", "$55.00", "$55.00", "$55.00"]
 ]
]

I am trying to get to the ["yellow", "green", "Blue"] array's length and loop to get the values

for(i=0; colorNSize.dataArray[0][0][1].length<i; i++){
    alert(colorNSize.dataArray[colorNSize.Sizeindex][0][0][i])// alert's nothing
   }

It actually alerts the length of "Large" which is "5" is there a limit for nested arrays? Can this be done?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about arrays