Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove the first item from an array

var arr = [1, 2, 3, 4]; 
var theRemovedElement = arr.shift(); // theRemovedElement == 1
console.log(arr); // [2, 3, 4]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #item #array
ADD COMMENT
Topic
Name
3+4 =