Voltar para todas as discussões
limit?
frandepaulo23-kixpsGDTqU8
2 years ago
How can I make a map with a limit of 10 games?
Junte-se à discussão - adicione o comentário abaixo:
Efetue login / inscreva-se para postar novos comentários
const indexOfLastGameInList = currentPage * gameItemPerPage;
const indexOfFirstGameInList = indexOfLastGameInList - gameItemPerPage;
const currentGameList = results.slice(
indexOfFirstGameInList,
indexOfLastGameInList
);
// then use map
{currentGameList.map((data) => {return <li>{data.xyz}</li>,}
I would like to know the same, I am looking for the option to bring a certain amount of elements. How can that be done?
I am trying to render in the DOM only 10 games of the more than 400 that are in the api…
some APIs can be assigned something like freetogame.com/api/games?limits=10 or api/games?results=10
does this api have that option?
What you trying to do exactly?