Created
August 29, 2020 02:34
-
-
Save fdorantesm/bb4a3637baa21b1725b4f3f4d18b5644 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function arrayPaginate(array, page_size, page_number) { | |
--page_number; // because pages logically start with 1, but technically with 0 | |
return array.slice(page_number * page_size, (page_number + 1) * page_size); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment