#Method to double array size and copy content.

1 messages · Page 1 of 1 (latest)

grave stirrup
#

Hey. I have an exercise where I was supposed to finish a method. See photo. My question is about the last line theCollection = newArray.

This seems to be necessary to do. But I dont see why for the method comment, I dont interpret it as theCollection array should now point to the newly made array? Maybe this is just something that should be understood in general?

fast edgeBOT
#

This post has been reserved for your question.

Hey @grave stirrup! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

spice maple
#

I guess the method is just supposed to double the size of theCollection by recreating it

#

else it would need to return the created array