
上QQ阅读APP看书,第一时间看更新
Using the shift method
To remove an element from the beginning of the array, we can use the shift method, as follows:
numbers.shift();
If we consider that our array has the value -4 to 12 and a length of 17 after we execute the previous code, the array will contain the values -3 to 12 and have a length of 16.