javascript - Saving data into Objects for Json Retrieval -


i working on saving data onto objects generated json input , later retrieved via load method. while saving data, due loop occurs in-between, breaking .push , re-pushing elements within loop shown below. but, while retrieving json output generated method, i'm unable access data pushed within loop , object value out of first push method.

i know if there way can perform of needed, within single .push itself. if not, suggestions in regard appreciated.

code in context

//first push node.push({     id:idofel,     class:dropelem,     position:     {         top: position.top,         left: position.left,         bottom: position.bottom,         right: position.right     },     name:createdsimplequeryarray[elid][1],     fromstream:     {         index:createdsimplequeryarray[elid][2][0],         name:createdsimplequeryarray[elid][2][1]     },     filter:createdsimplequeryarray[elid][3],     intostream:     {         index:createdsimplequeryarray[elid][5][0],         name:createdsimplequeryarray[elid][5][1]     } }); for(var ct=0;ct<createdsimplequeryarray[elid][4].length;ct++) {    //second push     node.push({         attributes:         {             name:createdsimplequeryarray[elid][4][ct][0],             type:createdsimplequeryarray[elid][4][ct][1]         }     }); } 

note

though there 2 push statements in above, object values 2 pushes correspond single element.(like various fields/columns in record of 1 element in database table)


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -