Add an item to the end of a List.
This function is the opposite of
To add an element elsewhere in a List, use
RememberThe terms “push” and “pop” come from a spring-loaded stack of plates in a cafeteria. The top-most plate is “popped” off, and new plates are “pushed” onto the stack.
$letters = ['a', 'b']; $letters.push('X'); //= ['a', 'b', 'X'] $letters.pop(); //= 'X' print($letters); //= ['a', 'b']