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 trialBrian Pelowski
7,202 PointsMethods Part 3 - Challenge task 1 of 3 On line 18, set the variable 'saying' to the concatenation of the 'first' and 'second' arrays with the word "dog".
I entered the following code: ".concat([second],"dog")"
var first = ["The", "quick", "brown", "fox", "jumps"]
var second = ["over", "the", "lazy"];
var saying = first.concat([second],"dog");
var shortSaying = saying;
var sayingString = saying;
It indicates that I generated the correct code, but apparently the syntax I used was not generated from the syntax that was wanted.
Bummer! Was expecting a 'saying' array of 'The,quick,brown,fox,jumps,over,the,lazy,dog' but got 'The,quick,brown,fox,jumps,over,the,lazy,dog'.
3 Answers
Mike Healy
2,451 Points" Was expecting a 'saying' array of 'The,quick,brown,fox,jumps,over,the,lazy,dog' but got 'The,quick,brown,fox,jumps,over,the,lazy,dog'."
Those are the same. Try without [] around second
var saying = first.concat(second,"dog");
Brian Pelowski
7,202 PointsThanks-
Jason Mc Dermott
11,496 Pointsthanks for the help but why aren't [] used for second, if its an array within an array isn't it needed?
Brian Pelowski
7,202 PointsBrian Pelowski
7,202 PointsHmmmm, I thought I had tried it that way.
But thank you-