Skip to content
Advertisement

How to get data without knowing key of json in react native

In response i get this king of data, here in data object there is various items but there key are kind of common so how can i get that data and add in my categories list.

JavaScript

here, how i tried to set the data in my list.

JavaScript

but when i don’t have the proper name of key then how can i add it to my list? ex. sometimes i get the key like…

JavaScript

So, how can i set the data in list without knowing the item key.

Advertisement

Answer

You can get key and value both by using following code

JavaScript

from this you can add values in your list

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement