Stand in Line - How do I recognize when new vars need to be created?

Tell us what’s happening:
I’m feeling like I have a learning disability or something because I could recognize that .push() and .shift() were going to be in play, however, I can’t seem to make the preschooler leap to incorporate the line “var removed = arr.shift();”.
Is this a normal type of issue when it comes to noobs? I’m started to doubt if I can really do this if I can’t even figure this out. I ended up working through the hints for about an hour until finally caving and just looking at the answer which is so defeating.
When reading the instructions are they clear as day for people or am I the only one who just didn’t get it?

Your code so far

function nextInLine(arr, item) {
  // Your code here
  arr.push([], 5);
  arr.shift([], 1);
  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/75.0.3770.100 Safari/537.36.

Link to the challenge:

You just need to learn were to find out if a method returns something, what it returns, if it also changes the array (or other data type) on which it was used or not

For example, here:

The shift() method removes the first element from an array and returns that removed element. This method changes the length of the array.

The push() method adds one or more elements to the end of an array and returns the new length of the array.

In the documentation, always look at what the function returns. You can always replace a function call with the return value of that function when you’re figuring out how it works, so if you look in the documentation, shift returns the value. And you can replace arr with an array (natch)


var item = [1,2,3].shift()
// Is the same as
var item = 1
// because shift returns the item that
// has been shifted off