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
Post a Comment