Function paginate

  • Returns a paginated array.

    Parameters

    • arr: any[]

      The array to paginate.

    • size: number

      The size of each page.

    Returns any[][]

    The paginated array.

    Example

    // [[1, 2], [3, 4], [5]]
    paginate([1, 2, 3, 4, 5], 2)