freeCodeCamp Challenge Guide: Stand In Line - Help

It is working code:

function nextInLine(arr, item) {
// Your code here
arr.push (item);
var removedItem = arr.shift();
return removedItem;
// Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

But I don’t understand, how function take value testArr ?
I don’t understand, how testArr relate to nextInLine if it don’t have mention.

Not sure what you mean, you pass testArr to the function: nextInLine(testArr, 6)

I could not do it, I looked at the decision in the “Get a hint”. And I try understand it. Where function take value array?
In testArr? How testArr relate to nextInLine?

you pass testArr to the function: nextInLine(testArr, 6) - Sorry, maybe this is a stupid question but I can’t find it in code (

Have a look at the code you posted :slightly_smiling_face:

:face_with_hand_over_mouth:

Thank you. I lost my eyes

1 Like

It’s a test value set for the function. which works in the console section.
console.log(nextInLine(testArr, 6)); // Modify this line to test

testArr takes the array values for this first param and value 6 for second param.

You can change the values.

thanks for your help its has been solved