Basic JavaScript: I don't understand how to create a function with out cordinates

Basic JavaScript: I don't understand how to create a function with out cordinates
0.0 0

#1

Tell us what’s happening:
can someone help me understand how I could do this please? I am so confused by this question.

here is the question

Write a function nextInLine which takes an array (arr) and a number (item) as arguments.

Add the number to the end of the array, then remove the first element of the array.

The nextInLine function should then return the element that was removed.

function nextInLine(arr, item) {
// Your code here
return item([2],1); // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log([2],1); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));


#2

I’ll walk you through the test case shown when you first loaded the page
You are given array with length of 5 and the number 6 to pass to your function.

var testArr = [1,2,3,4,5];
console.log(nextInLine(testArr, 6));

In your function
Your are to put that 6 onto the end of the array
Then take off the first number in array. In this test case the number 1
Then return the first number. That 1

So that
When done your array looks like [2,3,4,5,6] still same length as before
And console.log(nextInLine(testArr, 6)); logs 1 to the console

You are going to have to use array methods used in previous challenges to do this since you are unsure of the length of each test array.