Stand in Line issue are confusing

Tell us what’s happening:

can someone help me explain this
i think im a bit confused
Your code so far

function nextInLine(arr, item) {
  // Your code here
  return item;  // Change this line

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36.

Link to the challenge:

  1. Add the number to the end of the array,
    The push() method adds one or more elements to the end of an array…
  2. then remove the first element of the array.
    The shift() method removes the first element from an array and returns that removed element…
  3. The nextInLine function should then return the element that was removed.
    This is what its asking to make happen.
    …so we want to add 6 to the array remove 1 and return it…see test line
start with  // [1,2,3,4,5]
console.log(nextInLine(testArr, 6)); // Modify this line to test
end with // [2,3,4,5,6]