![]() |
VOOZH | about |
The forPage() function is used to return the value which is present at a particular page, this function take the page number as an argument and then returns the collection. In JavaScript, the array is first converted to a collection and then the function is applied to the collection.
Syntax:
data.forPage(x,y)
Parameters: This function accept two parameter as mentioned above and described below :
Return Value: Returns a new collection.
Below examples illustrate the forPage() function in collect.js
Example 1: Here in this example, we take a collection and then using the forPage() function we display the value from the page given as argument, and return the value
Output:
[ 6, 7, 8, 9 ]
Example 2: