Skip to main content
Version: v6.5.0

Pop-Last-Element

Command Description​

Pop the last element of the array

Command Prototype​

item = pop(array)

Parameter Description​

ParameterRequiredTypeDefaultDescription
arrayTrueexpression[]Need to delete and return the last element of the array

return​

item,The variable used to save the output of the command.

Demo​

TracePrint("----------------------Remove and return last element-------------------- ----") 
//-------------------------------------------------------------------------------
//[Remarks] Delete and return the last element of the array.
//Input parameter 1:
// array--The array that needs to remove and return the last element of the array.
//out parameters:
// item--The variable to which the output of the function call is saved.
//
//Command prototype: item=pop(array)
//-------------------------------------------------------------------------------
item=pop(["a","b","c"])
TracePrint(item)