For the complete documentation index, see llms.txt. This page is also available as Markdown.

ArrayPop

Remove last item in array and return it

Method Signature

ArrayPop(array=[modifiablearray], defaultValue=[any])

Arguments

Argument
Type
Required
Description
Default

array

modifiablearray

true

The array to get the last

defaultValue

any

false

The value to return when the array is empty. If omitted, an exception is thrown for an empty array.

Examples

Remove the last value from an array

This is the full function version of arrayPop to remove the last value of an array.

Run Example

arr = [ 
	1,
	2,
	42
];
p = arrayPop( array=arr );
writeOutput( p );

Result: 42

Member function version.

Using the member function.

Run Example

Result: 42

Additional Examples

Run Example

Last updated

Was this helpful?