Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript how to remove first element of array

var colors = ["red", "blue", "green"]

var firstColor = colors.shift()

console.log(firstColor) // red
console.log(colors) // blue green
Source by sebhastian.com #
 
PREVIOUS NEXT
Tagged: #javascript #remove #element #array
ADD COMMENT
Topic
Name
4+9 =