The collection.pop( ) method removes the last element from the collection and returns it as the function result.
Note: This method modifies the original collection.
When applied to an empty collection, collection.pop( ) returns undefined.
collection.pop( ), used in conjunction with collection.push( ), can be used to implement a first-in, last-out stack feature: