Syntax of shift() method is as given below:
var arr = new Array(3);
document.write("<b>Array before shift() is </b>=>"+arr+"<br> ");
document.write("<b>Shifted element is </b>=>"+arr.shift()+"<br> ");
document.write("<b>Array after shift() is</b>=>"+arr+"<br> ");
Example of Shifting array elements
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