How To Shift And Unshift Using JavaScript


  • 14 Mar, 2012

    <script type="text/javascript">var numbers = ["one", "two", "three", "four"];numbers.unshift("zero");document.write(" "+numbers.shift());document.write(" "+numbers.shift());document.write(" "+numbers.shift());</script>This produceszero one twoshift, unshift, push, and pop may be used on the same array in JavaScript. Queues are easily implemented using combinations.

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.