JavaScript Array push()
JavaScript Array push()
The push() method is used to add new items to the end of an array. It changes the length of the array and returns the new length.
Syntax:-
Its syntax is:- array.push(item1, item2, ..., itemX)
Return:-
Its return is:- length of new array after insertion of items.
Further Explanation:-
Parameters | Description |
item1, item2, ..., itemX | The items to add to the array. A minimum of one item is required. |