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
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: November 5, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles