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

Bummer! Nothing is Working.

Javascript Loops and Objects - Tracking Multiple Items with Arrays - Removing Items from an Array - Task 1

URL to Task: https://teamtreehouse.com/library/javascript-loops-arrays-and-objects/tracking-multiple-items-with-arrays/removing-items-from-an-array

Nothing I do seems to work, but in the console I can get the code to work.

This does not work: Bummer! It doesn't look like you called the .shift() method on the orderQueue array like this: orderQueue.shift();

var orderQueue = ['1XT567437','1U7857317','1I9222528'];
var shipping = [];
shipping.push(orderQueue.shift());

This does not work: Bummer! It doesn't look like you stored the first item from the array in the shipping variable.

var orderQueue = ['1XT567437','1U7857317','1I9222528'];
var shipping = [];
shipping.push(orderQueue[0]);
orderQueue.shift();

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Yes, your code is functional. However, they never say that the variable shipping should be an array. And I think that's where the challenge fails. Take a look at the code that passes the challenge.

var orderQueue = ['1XT567437','1U7857317','1I9222528'];
var shipping = orderQueue.shift();

Ah, so simple. I was about to just give up. Thanks so much!