shift:删除原数组的第一项,返回删除元素的值:如果数组为空则返回undefined var arr = [1, 2, 3, 4, 5]; var out = arr.shift(); console.log(arr); //[2,3,4,5] console.log(out); //1 var arr = []; var out = arr.shift(); console.log(arr); //[] console.log(out); //undefined unshift:将参数添加到…