Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

grouping several objects into a singular object

I'm making several requests to a server which return an object of an indeterminate length. the object looks smth like(taken from console.log):

​
0: Object { address: "0xcA2796F9F61dc7b238Aab043971e49c6164DF375", blockNumber: 6020249, transactionHash: "0x08802740ca54a0641c40267f19f2e651f4d960e384028d118246b52e138f41d1", … }
​
length: 1
​

: []

When I run console.log(JSON.stringify(res)); I get:

[{"address":"0xcA2796F9F61dc7b238Aab043971e49c6164DF375","blockNumber":6020249,"transactionHash":"0x08802740ca54a0641c40267f19f2e651f4d960e384028d118246b52e138f41d1","transactionIndex":10,"blockHash":"0x57e90a29c4f5dc26e455b49f6348b84e6d6bc5187ff7b029917a5261a8dcc4c5","logIndex":3,"removed":false,"id":"log_adcf3a60","returnValues":{"0":"0x0000000000000000000000000000000000000000","1":"0xE1980ADEafBb9Ac6C9BE60955484ab1547Ab0B76","2":"10000000000000000000000000000","from":"0x0000000000000000000000000000000000000000","to":"0xE1980ADEafBb9Ac6C9BE60955484ab1547Ab0B76","value":"10000000000000000000000000000"},"event":"Transfer","signature":"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","raw":{"data":"0x0000000000000000000000000000000000000000204fce5e3e25026110000000","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000e1980adeafbb9ac6c9be60955484ab1547ab0b76"]}}]

I have designed a series of loops to extract the necessary dat from this object. but think it would be more efficient if I group all of the requests into a single object and then iterate through that object.

I have tried to set up a variable and the adding each subsequent object through += or by setting the variable to an array and doing .push()

but when I print out the log for those object I just get a terribly long number of [Object][object]

Any ideas on how to approach this?

Comments