How would i return to first item in the array without having to make a new parameter or change the item one?

this func takes the first item in the array and adds a new item at the end.

how would i return to first item in the array without having to make a new parameter or change the item one?

current code:

function nextInLine(arr, item) {
  // Only change code below this line
  arr.shift();
  arr.push(item);
  item = arr[0];
  return item;
  // Only change code above this line
}

// Setup
const 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));
console.log(nextInLine([5, 6, 7, 8, 9], 1));
console.log(nextInLine([2, 1]));

shift() method returns the removed element. So you may push() first and then return shift() result right away. If I correctly understood the issue.

thank you code comrade