Tell us what’s happening:
I keep returning 1, 10 instead of just 10 how do i fix that?
Your code so far
function nextInLine(arr, item) {
// Your code here
arr.push(item)
return arr.shift(); // Change this line
}
// Test Setup
var testArr = [1,2,3,4,5];
// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 10), testArr[4]); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));