I'm pretty new to coding and currently, I'm coding a React native project. Sorry, if the question is too simple. I have tried many ways to navigate but failed. I have a JSON file and the data are as below.
{
"values" : {
"EquityTechnology": {
"_figure": [
9.138790534659202
],
"ICICIPrudentialTechnologyFundGrowth": {
"_figure": [
10.6484932862722
]
},
"Franklin Infotech Fund-Growth": {
"_figure": [
7.96902834459266
]
},
"Birla Sun Life New Millenium Fund - Growth - Regular Plan": {
"_figure": [
8.79884997311275
]
},
"SBI IT FUND - REGULAR PLAN - GROWTH": {
"_figure": [
null
]
}
},
"Equity - SmallCap": {
"_figure": [
14.0064060591969
],
"HDFC Small Cap Fund - Regular Growth Plan": {
"_figure": [
null
]
},
"Reliance Mid & Small Cap Fund -Growth Plan -Growth Option": {
"_figure": [
11.8481966627509
]
},
"Franklin India Smaller Companies Fund-Growth": {
"_figure": [
15.3302065566009
]
},
"Sundaram S.M.I.L.E.Fund-Growth": {
"_figure": [
11.754220292209
]
},
"SBI Magnum MIDCAP FUND - REGULAR PLAN - GROWTH": {
"_figure": [
14.9351631127958
]
},
"Birla Sun Life Small & Midcap Fund - GROWTH": {
"_figure": [
12.3666676648488
]
},
"L&T Emerging Businesses Fund - Regular Plan - Growth Option": {
"_figure": [
null
]
},
"Canara Robeco Emerging Equities - Regular Plan - GROWTH": {
"_figure": [
14.6579568171628
]
},
"Reliance Small Cap Fund - Growth Plan - Growth Option": {
"_figure": [
15.0019513606657
]
},
"DSP BlackRock Micro Cap Fund - Regular - Growth": {
"_figure": [
16.1568860065413
]
}
},
"Equity - Pharma": {
"_figure": [
12.966782129169834
],
"SBI PHARMA - REGULAR PLAN -GROWTH": {
"_figure": [
14.9918670876748
]
},
"UTI Pharma & Healthcare Fund-Growth Option": {
"_figure": [
11.2119667676491
]
},
"Reliance Pharma Fund-Growth Plan-Growth Option": {
"_figure": [
12.6965125321856
]
}
},
"Equity - MultiCap": {
"DSP BlackRock Equity Fund - Regular Plan - Growth": {
"_figure": [
8.32832307169916
]
},
"DSP BlackRock Opportunities Fund-Regular Plan - Growth": {
"_figure": [
9.72369143832476
]
},
"MOSt Focused Multicap 35-Regular Plan-Growth Option": {
"_figure": [
null
]
},
"Reliance Equity Opportunities Fund-Growth Plan-Growth Option": {
"_figure": [
9.79339882843478
]
},
"L&T Equity Fund-Regular Plan-Growth Option": {
"_figure": [
null
]
},
"IIFL India Growth Fund -Regular Plan - Growth": {
"_figure": [
null
]
},
"SBI Magnum Multicap Fund - REGULAR PLAN -Growth Option": {
"_figure": [
10.1704693596904
]
},
"Kotak Select Focus Fund - Growth": {
"_figure": [
10.7785458258239
]
},
"HDFC Equity Fund - Growth Option": {
"_figure": [
8.29168295966879
]
},
"Franklin India Flexi Cap Fund-Growth Plan": {
"_figure": [
9.52777086776355
]
},
"_figure": [
9.998290130663644
],
"Franklin India High Growth Companies Fund - Growth Plan": {
"_figure": [
12.0111958711599
]
},
"Birla Sun Life Equity Fund - Growth - Regular Plan": {
"_figure": [
10.5597033707683
]
},
"ICICI Prudential Value Discovery Fund - Growth": {
"_figure": [
12.494420125849
]
},
"Axis Equity Fund - Growth": {
"_figure": [
8.30198971811754
]
}
},
"Equity - FMCG": {
"_figure": [
12.9391809175777
],
"SBI FMCG FUND - REGULAR - GROWTH": {
"_figure": [
null
]
},
"ICICI Prudential FMCG Fund - Growth": {
"_figure": [
12.9391809175777
]
}
},
"Equity - Banking": {
"_figure": [
7.756301964533782
],
"UTI Banking Sector Fund-Income Option": {
"_figure": [
4.48544488820235
]
},
"Kotak Banking ETF": {
"_figure": [
null
]
},
"Birla Sun Life Banking and Financial Services Fund - Regular Plan - Growth": {
"_figure": [
null
]
},
"R*Shares Bank BeES": {
"_figure": [
null
]
},
"Reliance Banking Fund-Growth Plan-Growth Option": {
"_figure": [
8.2686147173821
]
},
"SBI BANKING & FINANCIAL SERVICES FUND - REGULAR PLAN - GROWTH": {
"_figure": [
null
]
},
"ICICI Prudential Banking and Financial Services Fund - Growth": {
"_figure": [
11.0147287026105
]
},
"UTI Banking Sector Fund-Growth Option": {
"_figure": [
7.25641954994018
]
}
},
"Gold Fund": {
"R*Shares Gold BeES": {
"_figure": [
null
]
},
"_figure": [
4.0762242905284065
],
"HDFC Gold Exchange Traded Fund": {
"_figure": [
6.03459415600124
]
},
"SBI GOLD EXCHANGE TRADED SCHEME": {
"_figure": [
6.14783904734468
]
},
"KOTAK GOLD ETF": {
"_figure": [
-3.40119263557552
]
},
"Kotak Gold Fund Growth": {
"_figure": [
5.61706623223513
]
},
"Axis Gold ETF": {
"_figure": [
5.9828146526365
]
}
}
}
}
I want to navigate through the JSON using the index as the data will be dynamic and the names could change over time. What should I do to access, for example, '14.9918670876748' under '_figure' of 'SBI PHARMA - REGULAR PLAN -GROWTH' which in turn is under 'Equity - Pharma'. I want to retrieve '_figure' of all the items. I have tried for..in loop but it returned only the indexes of nested objects. Is there any way I can navigate through the JSON file using indexes?
Thank you in advance.
Sorry for the bad english.