JavaScript JavaScript Loops, Arrays and Objects Tracking Multiple Items with Arrays Removing Items from an Array

Definiti Media
Definiti Media
6,082 Points

why it not works var orderQueue = ['1XT567437','1U7857317','1I9222528']; var shipping = [ orderQueue.shift()];

var orderQueue = ['1XT567437','1U7857317','1I9222528']; var shipping = [ orderQueue.shift()];

script.js
var orderQueue = ['1XT567437','1U7857317','1I9222528'];
var shipping = [ orderQueue.shift()];
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

Sean T. Unwin
MOD
Sean T. Unwin
Treehouse Moderator 28,611 Points

We just need the String of the first value, not an Array. Remove the square brackets surrounding the shift() call.