![]() |
VOOZH | about |
The push() function is used to add a new value to the end of the collection. In JavaScript, the array is first converted to a collection and then the function is applied to the collection.
Syntax:
data.push(value)
Parameters: This function accepts a single parameter as mentioned above and described below:
Return Value: Returns a modified collection which is created by this function.
Below examples illustrate the push() function in collect.js
Example 1:
Output:
[ 'Geeks', 'for', 'Geeks', 'CS' ]
Example 2: