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 are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.