remove the first element in an array with shift

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

Javascript

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);

Demo

Welcome

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.

❤👩‍💻🕹