Javascript Push() Function

The push() function of array object adds one or more elements to the end of the array and return new length of the array. Use it for example to appends elements in array.

Syntax

Javascript Push() Function Example1

This will produce following result

Javascript Push() Function Example2

This will produce following result