The reason you are failing those tests/challenges is because you do not understand what the pop method does. Can you explain to me what you think testArr.pop(5) does?
To post code into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
Can you please post the full code in the challenge that you are using to solve this challenge? We can not help you if we can not see your latest full code.
You are supposed to add the 2nd argument (represented by item parameter) to the end of the first argument (represented by arr parameter). arr is an array, so Which array method adds a new element to an array?
The second thing you are supposed to do is remove the first element of arr and return it from the function. Which array method removes the first element of an array and returns the element removed?
If you are unable to answer these questions, then I strongly suggest you review the following challenges as it seems you do not understand how they work (based on the code you have written).
function nextInLine(arr, item) {
// Only change code below this line
// Add one line of code that adds `item` to the end of `arr`
// Add one line of code that removes the first element of `arr` and assigns the removed element to a new variable.
// return the new variable;
// Only change code above this line
}