Okay, so… I’m a bit confused with how to deal with this.
I’ve completed the code and managed to narrow it down to
function nextInLine(arr, item) {
// Only change code below this line
arr.push(item);
return(arr.shift());
// Only change code above this line
}
While that returns as correct, I was wondering if someone could pinpoint exactly why the below 2 code ALSO returned as correct?
function nextInLine(arr, item) {
// Only change code below this line
arr.push(item);
return(arr.shift(item));
// Only change code above this line
}
and
function nextInLine(arr, item) {
// Only change code below this line
arr.push(item);
var shifted = arr.shift(item);
return(item, shifted);
// Only change code above this line
}
In both cases, item is totally ignored but still gains a pass. Is there any specific reason to why?