remove first occurrence of an object in array javascript code example
Example: javascript remove first item from array
var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];
var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];