Hi guys. I have a javascript array that looks like this:
'40x27' => array(
'1' => 0
'1.5' => 2
'2' = 1
)
'36x24' => array(
'1' => 1
'1.5' => 1
'2' = 2
)
etc.
I want to print out the values of the inner array like this:
i = 0;
for (i in outerArray){
var k = 0;
for (k in innerArray){
alert(innerArray[k]);
}//for
}//for
The issue I am having is that the k
variable has the value of outerArray[i]
instead of the key of the innerArray
like so:
i=0;k="40x27";
i=0;k="36x24";
i=1;k="40x27";
i=1;k="36x24";
Edit: sorry I forgot to include some code.
var outerArrays=new Array("40x27","36x24");
var innerArray=new Array("1","1.5","2");