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 trialAimee Weiß
9,678 PointsRegarding the next challenge, i can't find the right solution. Help
I tried 2 approaches and they worked in Visual Studio Code, but the test won't accept it. Can someone tell me what i am doing wrong?
const orderQueue = ['1XT567437','1U7857317','1I9222528']; const shipping = [orderQueue.shift()];
Or: const orderQueue = ['1XT567437','1U7857317','1I9222528']; const item = orderQueue.shift() const shipping = [item];
1 Answer
Martin Sole
82,199 PointsHi
As you are calling a JS Method on an array you don't need to wrap this in square brackets, so for example arrayName.pop() doesn't need square brackets around it. You almost have the correct answer in both examples, just in the first it is inside square brackets and in the second example it is assigned to the variable 'item'.