Ответ 1
Это должно удалить первый элемент, а затем вы можете вернуть оставшиеся:
var myarray = ["item 1", "item 2", "item 3", "item 4"];
myarray.shift();
alert(myarray);
var myarray = ["item 1", "item 2", "item 3", "item 4"];
//removes the first element of the array, and returns that element.
alert(myarray.shift());
//alerts "item 1"
//removes the last element of the array, and returns that element.
alert(myarray.pop());
//alerts "item 4"
Это должно удалить первый элемент, а затем вы можете вернуть оставшиеся:
var myarray = ["item 1", "item 2", "item 3", "item 4"];
myarray.shift();
alert(myarray);
Попробуйте
var myarray = ["item 1", "item 2", "item 3", "item 4"];
//removes the first element of the array, and returns that element apart from item 1.
myarray.shift();
console.log(myarray);
Вы можете использовать array.slice(0,1)//Первый индекс удаляется и возвращается массив.