Im having problems with the javascript stand in line section. my code seems like it does what it is supposed to.
// Only change code below this line
let x = arr[0];
arr.push(item);
arr.shift();
return x
// Only change code above this line
}
// Setup
let testArr = [1, 2, 3, 4, 5];
// Display code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6));
console.log("After: " + JSON.stringify(testArr));
```javascript
function nextInLine(arr, item) {
// Only change code below this line
let x = arr[0];
arr.push(item);
arr.shift();
return x
// Only change code above this line
}
// Setup
let testArr = [1, 2, 3, 4, 5];
// Display code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6));
console.log("After: " + JSON.stringify(testArr));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Challenge: Basic JavaScript - Stand in Line
Link to the challenge: