Shift Array Left Method

The Shift Array Left method shifts all array elements by one position back. The first element is lost. It returns the modified array. It does not include any input arguments.

Format

shift()

The following example includes the Shift Array Left method:

var v = new Array;
v[0] = 7;
v[1] = 3;
v[2] = 4;
v[3] = 11;
v.shift();  // now v[0] becomes 3, v[1] becomes 4, v[2] becomes 11