removing first item array js
snippet in javascript

remove a particular element from array

user9549

var colors = ["red","blue","car","green"];
var carIndex = colors.indexOf("car");//get  "car" index
//remove car from the colors array
colors.splice(carIndex, 1); // colors = ["red","blue","green"]

remove first element from array javascript

user4011

var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.shift();

removing first item array js

user3620


var list = ["bar", "baz", "foo", "qux"];
list.shift()//["baz", "foo", "qux"]