javascript check array element after first element code example
Example: js get 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"];