Pop-First-Element
Command Description
Pop the first element of the array
Command Prototype
item = Shift(array)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
array | True | expression | [] | Need to delete and return the first element of the array |
return
item,The variable used to save the output of the command.
Demo
TracePrint("----------------------Remove and return the first element------------------- ------")
//-------------------------------------------------------------------------------
//[Remarks] Delete and return the first element of the array.
//Input parameter 1:
// array--an array whose first element needs to be removed and returned.
//out parameters:
// item--The variable to which the output of the function call is saved.
//
//Command prototype: item=Shift(array)
//-------------------------------------------------------------------------------
item=Shift(["a","b","c"])
TracePrint(item)