I am having trouble parsing these data in React. Can someone help, please?
{
'a':{
'name':'zou',
'age':'23'
},
'b':{
'name':'zaa',
'age':'20'
},
'c':{
'name':'zee',
'age':'21'
}
}
I’m trying to go through each element to get and display their names and age.
3
Answers
You can first get all the keys from the object and then loop over the object keys (in this case [a,b,c]) and get the desired result.
Hope it will be helpful.
You can iterate through the heys of this dict (data) and append the needed data in another dict to iterate through in React Component.
If you can provide the react component code could be an easier way.