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
Combining arrays into a single string.
Finish the code by adding the array method that combines all of the items in an array into a single string.
var students = ["Sally", "Joan", "Raphael", "Sam"]; var message = "Hello " + students.?(", ");
Steven Parker227,141 Points
The join() method joins all elements of an array (or an array-like object) into a string and returns this string.
You will find a list of array methods on the left side of the MDN Array page. They are all links, so click on any method name to go to the page for that method. Also you can just hover the cursor over a method to get a description tooltip.