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 Arrays Store Multiple Values in an Array Remove Elements From an Array

Cody Norman
seal-mask
.a{fill-rule:evenodd;}techdegree
Cody Norman
Full Stack JavaScript Techdegree Student 3,421 Points

What is the "correct" answer?

https://w.trhou.se/1vfm6618ix

script.js
const orderQueue = ['1XT567437','1U7857317','1I9222528'];
const shipping = [];
orderQueue.shift();
shipping.push('1XT567437');
Cody Norman
seal-mask
.a{fill-rule:evenodd;}techdegree
Cody Norman
Full Stack JavaScript Techdegree Student 3,421 Points

I've tried 6 different ways, all of which work. but I keep getting: Bummer: Make sure that you're assigning the first element of the array to the shipping variable.

Also unrelated the reason I added this comment is because I couldn't type everything in the original question for some reason.

1 Answer

Steven Parker
Steven Parker
229,644 Points

Here's some hints:

  • don't replicate the value, access it by indexing into the array
  • don't create a new array, just assign the value directly to the variable