vendredi 25 novembre 2016

set dynamic JSON key value pairs in ember

I am having a list of array elements (i.e., ["test1","test2","test3"]), now i have to set this values as key for json data, how to set this?

I tries this,

var listOfStoreValue = [ "test1", "test2", "test3"];
listOfJSONObj[j] = [];
for (k = 0; k < Response.length ; k++) 
{
 listOfJSONObj[j].push({listOfStoreValue[j] : Response.get(Value[j])[k]});
}

but it shows syntax error!




Aucun commentaire:

Enregistrer un commentaire