What does pop return when called on an empty array?
Explanation
There is no last element to remove, so pop returns undefined and leaves the array empty. Throwing a range error would be a plausible bounds policy, but it is not how this array method is specified.