elem = array.pop();
Removes the last element from an array and returns that element.
See also: Array.push(), Array.shift(), Array.unshift()