Skip to content

Instantly share code, notes, and snippets.

@coder618
Created July 10, 2020 10:28
Show Gist options
  • Select an option

  • Save coder618/b83600e2cb302168951cfd7bd8276e29 to your computer and use it in GitHub Desktop.

Select an option

Save coder618/b83600e2cb302168951cfd7bd8276e29 to your computer and use it in GitHub Desktop.

Revisions

  1. coder618 created this gist Jul 10, 2020.
    7 changes: 7 additions & 0 deletions return pagination index
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    function returnIndex() {
    var postsPerPage = 12;
    console.log('return start endindex ', page, postsPerPage);
    let startIndex = postsPerPage * page;
    let endIndex = startIndex + postsPerPage;
    return [ startIndex, endIndex ];
    }