Answer the question
In order to leave comments, you need to log in
How to limit the output of data from an array in JavaScript?
How to limit the output of data from an array in JavaScript?
There is an array: [{},{},{},{},{},{}, .... more than 500 indices];
I want to make sure that initially I get them 50 pieces, the rest only if necessary, again 50 each and not all at once.
Answer the question
In order to leave comments, you need to log in
const arr = [...]
let part = 1; // или в стейте
const getAnother50 = () => {
return arr.slice((part - 1) * 50, part * 50)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question