We can add the elements into the array object with the use of push() method. push() method adds one or more elements to the array object and also returns the new length of the array.
var arr=new Array(2);
document.write("Array arr contains(Before push())="+arr+"</br>");
document.write("Array arr contains(After push()) ="+arr+"</br>");
<h2>Example of array's push() </h2>
Push method insert the new element at the end of array
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial