I can get the result 2,3,4,5,6 with the following code, but I don’t seem to have the right answer?
**Your code so far**
function nextInLine(arr, item) {
// Only change code below this line
arr.push(6);
var x = arr.shift();
return x;
// Only change code above this line
}
// Setup
var 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 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36.