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
taahrqqhar
14,147 PointsSOME 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
Sergi Beltran
18,493 PointsYou need to call the method push and insert a variable as a parameter.
Sjoerd van den Belt
6,692 PointsYou are using the wrong function, you shouldn't use the shift function for this but a function called "push".
Sjoerd van den Belt
6,692 PointsYou are using the wrong function, you shouldn't use the shift function for this but a function called "push".
Sorry for double post :/
taahrqqhar
14,147 Pointsi used push but its not work
Mike Costa
Courses Plus Student 26,362 Pointsyour variable name is wrong. the w should be uppercase.
saying.push(lastWord);
taahrqqhar
14,147 Pointstaahrqqhar
14,147 Points<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