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 trialQasim Rashad
Front End Web Development Techdegree Student 7,837 PointsHelp with question
It's telling me error but don't know what I did wrong. Am I'm missing something?
var orderQueue.shift= ['1XT567437','1U7857317','1I9222528'];
var shipping ('1XT567437');
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Loops</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
2 Answers
Kendell Dancy
15,158 Points- First create a new variable named shipping. var shipping
- Secondly we need to remove the first element of the array and add that first element to the variable shipping.
- We can do this by using the .shift() method on our orderQueue array like so... shipping = orderQueue.shift(); *The .shift() method removes the first element in an array and returns that element.
Ben Reynolds
35,170 PointsThe values for both of the variables you'll create in this challenge should be set by calling the appropriate array method on orderQueue, see this video for a demonstration:
Arafat Patwary
10,233 PointsArafat Patwary
10,233 Pointshttps://teamtreehouse.com/community/orderqueue-array This answer should help you. you need to run orderQueue as a function after you declare the Array.