Created
July 10, 2020 10:28
-
-
Save coder618/b83600e2cb302168951cfd7bd8276e29 to your computer and use it in GitHub Desktop.
Return pagination index for array
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 returnIndex() { | |
var postsPerPage = 12; | |
console.log('return start endindex ', page, postsPerPage); | |
let startIndex = postsPerPage * page; | |
let endIndex = startIndex + postsPerPage; | |
return [ startIndex, endIndex ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment