Answer the question
In order to leave comments, you need to log in
Get length of JSON array?
There is a simple react application in which I receive JSON from the server and build a table based on it.
There is also functionality for adding a new element to the table.
JSON is not loaded all at once, but the so-called infinite loader is used. It comes in 20 items.
How to get the total length of an array to add it to the end of the table?
Answer the question
In order to leave comments, you need to log in
1. Look in the server response if this value already exists.
2. If not, then ask the backend to complete this value.
3. If you want to be stubborn, you can run the script through all the pages to get the amount. It will do if you really need to display the value, and the back will not be added soon, but there is a chance to dump the page with requests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question