Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

pagination in typescript

function paginate(items: any[], pageNumber: number, pageSize: number) {
  const startIndex = (pageNumber - 1) * pageSize;
  return items.slice(startIndex, startIndex + pageSize);
}
 
PREVIOUS NEXT
Tagged: #pagination #typescript
ADD COMMENT
Topic
Name
4+4 =