Welcome to the Treehouse Community
Looking to learn something new?
Maurice Tafolla- Cunningham7,708 Points
I get an error telling me "that it doesn't look like you called the .shift() method on orderQueue. Try using orderQueue.shift()."
Check out my code:
Clearly I am, unless I'm daft. What's up? My task it to put the first item from orderQueue into the shipping variable. Also I don't know why there is a HTML file attached with this. Sorry?
var orderQueue = ['1XT567437','1U7857317','1I9222528']; var shipping = ; shipping.push(orderQueue.shift());
Tobias Helmrich31,601 Points
actually your idea was really good because if there are more items shipping at the same time it would be useful to have an array for that. However in this challenge shipping should just be a variable where you store the removed first item from the orderQueue array.
It should work like this:
var orderQueue = ['1XT567437','1U7857317','1I9222528']; // Task 1 var shipping = orderQueue.shift(); // Task 2 var cancelled = orderQueue.pop();
Per Karlsson12,683 Points
You want to save the first value in the array into the variable shipping. shift() removes the first item in an arrays.
So try this out:
var shipping = your shift goes here.
Let me know if you need more help.