Removes the last item from the end of the specified list. The supplied list must be modifiable.
:-) var list = newList( "a", "b" );
:-) list;
There is 1 result
[a, b]
:-) list.removeLast();
There are 0 results;
:-) list;
There is 1 results
[a]
If you try to update a unmodifiable list, you will get a mishap, e.g.
:-) { "a", "b" }.removeLast();
MISHAP : Trying to remove an item to an immutable list
BECAUSE : Immutable lists cannot be altered
ITEM : [a, b]
DOING : <function removeLast>
LINE NO. : 1
PHASE : Evaluation
Trapped : org.millscript.millscript.Alert$EscapeException
Resetting input and resuming execution