I still don’t understand, nextInLine is a function.
it is adding and removing from testArr.
testArr has 1-5 in it,
moving from 0, 2 is the third item on the list, which would be 3.
I’m not understanding my faulty logic.
This is not true. It is using whatever array is passed in as the arr argument.
So, nextInLine([2], 1) says, “use the arr = [2], add the item = 1 to the end of the arr, remove the first element of the arr, and return the removed element”