I have 'multidimensional associative' javascript array (which in fact is object with properties as JS can't have native associative array):
var multiArray={ AAA:"one", BBB:"two", CCC:{ 0:"xxx", 1:"yyy", 2:"zzz"} };
And i need to get such string from this array:
'AAA=one & BBB=two & CCC=xxx,yyy,zzz'
How do I do that?
If i use two simple loops like this:
for(var key in multiArray)
{
for(var subkey in multiArray[key])
{
string = string + multiArray[key][subkey]+",";
}
}
I get something like this:
'AAA = o,n,e & BBB = t,w,o & CCC = xxx, yyy,zzz'
Which is not what i need.
Any solutions using Javascript only?
multiArray['CCC']
not an array? – kojiro May 19 '12 at 15:20