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

SOME ONE HELP WITH THIS JAVASCRIPT METHOD1!1!

On about line 21, add the 'lastWord' variable to the end of the array 'saying'. http://teamtreehouse.com/library/javascript-foundations/arrays/methods-part-1

question this is the 4th challenge I can't get it... http://teamtreehouse.com/library/websites/javascript-foundations/arrays/methods-part-1-elements saying.shift();

4 Answers

You need to call the method push and insert a variable as a parameter.

<script> var spareWords = ["The","chimney","sweep's","dog"]; var saying = ["quick", "brown", "fox", "jumps", "over", "the", "lazy"]; var firstWord = spareWords.shift(); var lastWord = spareWords.pop(); saying.unshift(firstWord); saying.push(lastword); </script>

this is not working.... I tried

You are using the wrong function, you shouldn't use the shift function for this but a function called "push".

You are using the wrong function, you shouldn't use the shift function for this but a function called "push".

Sorry for double post :/

i used push but its not work

your variable name is wrong. the w should be uppercase.

saying.push(lastWord);