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! While you're at it, check out some resources Treehouse students have shared here.

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

JavaScript JavaScript Foundations Arrays Methods: Part 3

Wenwei Lu
Wenwei Lu
10,897 Points

On line 18, set the variable 'saying' to the concatenation of the 'first' and 'second' arrays with the word "dog".

var first =  ["The", "quick", "brown", "fox", "jumps"]
var second =  ["over", "the", "lazy"];
var saying = (first.push(dog)).concat(second);

what is the wrapper, container in div tag, whats the use of it in this?

1 Answer

The concat method accepts numerous values as parameters.

So the dog should go as the second parameter of the concat. You also don't have a variable dog, it should be a string literal, like this: "dog".

And you don't need .push at all.

var someArray = anArray.concat(anotherArray, "some string");