5

I have JSON object taken from Firebase real-time database. What I want is make an array from object and pass this array to state. Hence I want to pass this data to FlatList Component.

This is how my Object looks like:

enter image description here

Actually, I don't need keys, just like this ->

enter image description here

I need your help because I just started to learn JS, before was programming on Android Studio

1 Answer 1

14

You can use Object.values to get an array:

const array = Object.values( obj );
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.