Are the tests broken?

Tell us what’s happening:

Your code so far


function nextInLine(arr, item) {
// Only change code below this line
arr = arr.push(item)
item = arr.shift();
return item;
// 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 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36.

Challenge: Stand in Line

Link to the challenge:

Hi and welcome to the forum.

The push does not return the array. Try console.loging the result after the line I’ve quoted and you’ll see your bug.