<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 produces zero one two shift, unshift, push, and pop may be used on
the same array. Queues are easily implemented using combinations.
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
<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 produces
zero one two
shift, unshift, push, and pop may be used on the same array. Queues are easily implemented using combinations.