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

Methods Part 1 : Challenge Task 3.

Hey everybody. So I'm having a problem with the task 3 of 4. I enter the code below. And keep getting an error. What is it that I'm doing wrong. Thank you .

saying.unshift("firstWord");

Hi Peter,

Remove the quotation marks around firstword.

Jeff

I tried and got the response off "something isn't right with your code." :(

2 Answers

The following code passed for me.

<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>

I switched from Google Chrome to FireFox and it worked perfectly. Tried it again with Google and still didn't work. Who cares, I finally passed that exercise. Thanks Jeff. It was driving me mad. :)