This function removes an element from the end of an array.