Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Array

On about line 19, set the variable 'shortSaying' to be a slice of the 'saying' array to include the strings of "quick", "brown", and "fox".

im really stuck here any help???

4 Answers

Can you provide a little more? What lesson (language) are you working on and what does your code look like?

Hi Dave This what im doing but comes out wrong. <script> var first = ["The", "quick", "brown", "fox", "jumps"] var second = ["over", "the", "lazy"]; var saying = first.concat(second,"dog");

  var shortSaying = saying.slice(1, 2, 3);   // but says wrong ?

  var sayingString = saying;
</script>

Based on the code you provided, the slice returns the word 'quick'. You want it more like var shortSaying = saying.slice(1,4); I don't know what the third number is for...the slice syntax is 'string.slice(start,end)'. That is probably where you are running into an issue.

Thanks Dave that helped i didn't remove the "var" thanks again took me a 1 hour and fell a sleep haha.