function nextInLine(arr, item) {
// Your code here
arr.push (item);
var removedItem = arr.shift();
return removedItem;
// 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));
But I don’t understand, how function take value testArr ?
I don’t understand, how testArr relate to nextInLine if it don’t have mention.
I could not do it, I looked at the decision in the “Get a hint”. And I try understand it. Where function take value array?
In testArr? How testArr relate to nextInLine?