function nextInLine(arr, item) {
// Only change code below this line
arr.push(item);
const removed = arr.shift();
return removed;
// Only change code above this line
}
I can’t figure out why my code is not passing. I have tried everything and can’t see why I’m not passing any tests. Here is my code:
function nextInLine(arr, item) {
// Only change code below this line
arr.push(item);
arr.shift();
return arr.shift();
// Only change code above this line
}
If you have a question about a specific challenge as it relates to your written code for that challenge, and you’ve tried to solve it at least 3 times so far and still need some help, just click the Ask for Help button located on the challenge (it looks like a question mark).
This button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.