javascript - Iterating through a Dictionary to add to another -


i trying loop through each value in dictionary , go out , dictionary based on 1 of objects in first dictionary through each loop iteration:

var dalbumphotos = {};  // holds list of photo objects var dalbumsandphotos = {}; // hold album | dalbumphotos each album  for(var in dalbums) {     dalbumphotos = getphotosforalbum(userid, accesstoken, a.id);      dalbumsandphotos(a) = dalbumphotos; } 

i'm not quite sure how without index. need increment through dalbumphotos , append final dictionary album , it's dalbumphotos

it looks you're using associative array in javascript should able change last bit of code be:

for(var in dalbums) {     dalbumphotos = getphotosforalbum(userid, accesstoken, dalbums[a].id);     dalbumsandphotos[a] = dalbumphotos; } 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -