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 Loops, Arrays and Objects Tracking Multiple Items with Arrays Removing Items from an Array

Logan Murphy
Logan Murphy
1,685 Points

clearing challenge

I have tried typing the string directly into the shipping array. I have also tried using the index [0] to type shipping[0] = orderQueue[0];

I've also tried several other combinations, but to no avail though it is working in the console to provide the correct results. Thanks in advance for your help.

script.js
var orderQueue = ['1XT567437','1U7857317','1I9222528'];
var shipping = ['1XT567437'];
orderQueue.shift(0);
index.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JavaScript Loops</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

1 Answer

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

Hi, Logan! You're on the right track, I think. You understand that the first item in an array is at position 0 and that's excellent! The shift function does not need a parameter. It always takes the item at position 0. It's wanting you to use the shift function on the orderQueue and assign the result (which will be the first item) to the shipping variable.

I think you can get it with these hints, but let me know if you're still stuck! :sparkles: