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 1

yosef levertov
yosef levertov
5,497 Points

I've been stuck on this problem for a few weeks now, some help please...

can't get past part 1 of 4

Hi Yosef, can you edit your post to include the code that you're trying?

3 Answers

James Barnett
James Barnett
39,199 Points

Here's a hint as the wording of this challenge leaves something to be desired.

  1. Remove the first value from the array
  2. Remove a value to the end of the array
  3. Add a value to the beginning of the array
  4. Add a value to the end of the array

Check out this list of JavaScript array-related methods and see if you con figure out the correct method to use for each of the 4 steaps


If you need a refresher on the syntax for these methods check out this page

Let me reword what they're asking for because it reads a little too vaguely even for me:

On line 18, use a method on the 'spareWords’ array to set 'firstWord' to be first word of the 'spareWords’ array. Also be sure that the first word of the spareWords array is removed from the array.

So what they are wanting is for you to remove the first word from the "spareWords" array and set it equal to the variable "firstWord" that has already been declared.

Eivind Jonassen
Eivind Jonassen
5,994 Points

I was stuck on that challenge for quite some time as well.. Maybe the persons in charge of the course can look at it and maybe ask the question in a different manner. Also change the variable names, because it makes it hard to read and comprehend as it is now.