function nextInLine(arr, item) {
// Your code here
arr.push(item);
removed = arr.shift();
return removed; // Change this line
}
// Test Setup
var testArr = [];
// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 1)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
nextInLine(testArr, 1)
nextInLine(arr, item) {
var arr = testArr; //The first argument and the first parameter.
var item = 1;//The second argument and the first parameter.