Remove and return the last item in a List.
This function is the opposite of
To remove 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.
let letters = ['a', 'b']; letters.push('X'); //= ['a', 'b', 'X'] letters.pop(); //= 'X' print(letters); //= ['a', 'b']