Welcome to the Treehouse Community
Looking to learn something new?
Katie Dunayczan8,616 Points
Not sure what I'm doing wrong
I don't understand how to take an item out of an array and put it in another array. I assume you save that item in a variable?
var orderQueue = ['1XT567437','1U7857317','1I9222528']; var shipping = ; var foo = orderQueue.shift(); shipping.push(foo);
Remember, arrays ARE variables. You shouldn't have to create a new variable just to store the value you are moving.
Think of functions and methods as a washing machine... A washing machine doesn't care what you put in, it will always just go through the steps of cleaning clothes, and returns them... Similarly, methods and functions don't care what you pass in, they just return a value.
.shift() returns the value you are dropping; So, you should be able to store that returned value into the destination array:
var orderQueue = ['1XT567437','1U7857317','1I9222528']; var shipping = ; shipping.push(orderQueue.shift());
That should do the magic.