Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Kevin Faust15,353 Points
hmm so which array is the best one?
So craig explained 3 different ways to add stuff to an array. For me, the easiest way is just using the copyOf() method as its the most simple and clean. I have added the other 2 ways but they look so messy and bothersome. Will there be cases where I would have to use them or can I just use copyOf() all the time?
or is it just more of a know-how-each-works but just use whichever you like most
Of the solutions presented in this lecture, copyOf seems to be the best way "always". It looks the cleanest and requires the least code (and the least use of crazy old code that doesn't even follow "current" naming conventions).
I'm really hoping that Craig shows us an additional "better way" in the upcoming lectures though. Two instructions to add each item to an array seems pretty wasteful and messy to me.
Yep, lol, I've progressed further in the course now myself ... lists are so much more practical :)