Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Removes the first element from an array and returns that element.
function shift() : Object
Remarks
The shift method removes the first element from an array and returns it.
Example
The following example illustrates the use of the shift method.
var ar = new Array(10, 11, 12);
var s = "";
while (ar.length > 0)
{
var i = ar.shift();
s += i.toString() + " ";
}
print (s);
// Output: 10 11 12