this question has answer here:
- loop through array in javascript 34 answers
i know how loop of sql datas (that parsed json table) array, adding key each of them.
i know how can loop of data simple string :
var dbstring =""; for(i = 0; < result.response.length; i++) { dbstring += result.response[i].names; }
this
var dbstring = "james michael alfred....";
but how can make :
var dbstring = {"james":1, "michael":2, "alfred":3, .....}
thanks.
it's unique demand organise list of names want, here is:
var dbstring = {}; var names = result.response; for(var = 0; < names.length; i++){ dbstring[names[i]] = + 1; }
Comments
Post a Comment