remove the first element in an array with shift

like pop but shift does the 1st element in an array


var my_array = [ ["cat", 1], ["dog", 2],["fish", 3] ];
var my_array_item = my_array.shift();
console.log("the removed item: "+my_array_item);
console.log("the array: "+my_array);

Other Items in javascript
Page Views

This page has been viewed 267 times.

Search Code
Search Code by entering your search text above.

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.


Random Quote