Not long ago began to study react native. And ran into a problem. Trying to parse https://www.cryptocompare.com/api/data/coinlist And get links to pictures from the Data section I myself got the section

dataImages: Array(responseJson.Data) console.log(this.state.dataImages[0]) 

Looks like that:

 "42": { "Id": "4321", "Url": "/coins/42/overview", "ImageUrl": "/media/12318415/42.png", "Name": "42", "Symbol": "42", "CoinName": "42 Coin", "FullName": "42 Coin (42)", "Algorithm": "Scrypt", "ProofType": "PoW/PoS", "FullyPremined": "0", "TotalCoinSupply": "42", "PreMinedValue": "N/A", "TotalCoinsFreeFloat": "N/A", "SortOrder": "34", "Sponsored": false }, "300": { "Id": "749869", "Url": "/coins/300/overview", "ImageUrl": "/media/27010595/300.png", "Name": "300", "Symbol": "300", "CoinName": "300 token", "FullName": "300 token (300)", "Algorithm": "N/A", "ProofType": "N/A", "FullyPremined": "0", "TotalCoinSupply": "300", "PreMinedValue": "N/A", "TotalCoinsFreeFloat": "N/A", "SortOrder": "2212", "Sponsored": false },... 

Despite the fact that I added '[0]' I can get an element if I put '.DOGE' (the name of the element) after. But I need to get the ImageUrl or Name field from all the elements. Tell me please what am I doing wrong

    1 answer 1

    This is how I walked through all the elements.

     for (var key in this.state.dataImages) { if (key == coinKey) { urlImage = `${this.state.dataImages[key].ImageUrl}` } }