Answer the question
In order to leave comments, you need to log in
How to return a list of posts / comments, etc. - as an object or an array?
The situation when the API arrives, for example, a list of comments. The vast majority of tutorials do it simply - an array with objects. But I noticed that many real applications return data as an object, where the key is the ID, and the value is the content itself.
What are the advantages of this method? Is it worth doing the same?
APD. It seems that here is the source of this trend - https://firebase.googleblog.com/2014/04/best-pract...
Google believes that arrays are evil.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question