Javascript acces array element inside an array of arrays -


var outer = new array(); var inner = new array();  inner[0] = "target"; outer[0] = inner; 

so in javascript whats correct syntax access string target?

var target = outer[0][0];   //correct 

or sth. like

var target = outer[0].[0];  //false don´t use 

to access array need use

var target = outer[0][0]; 

the dot notation seem confusing in second suggestion used access object properties. if have

var outer = new object(); var inner = new object();  inner.item = "target"; outer.item = inner; 

you use outer.item.item access "target".


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -