Resize the array, adding n
new elements, which have undefined
values. The return value is an array pointing to the newly allocated elements. The returned pointer becomes invalid when the list is resized. Resizes list if self.capacity
is not large enough.