Could anyone assist me with what I should do?

Tell us what’s happening:

Your code so far

function nextInLine(arr, item) {
// Only change code below this line

return item;
// Only change code above this line


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

// Display code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6));
console.log("After: " + JSON.stringify(testArr));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.60.

Challenge: Stand in Line

Link to the challenge:

Hi @Brijesh!

FCC instructions:
Add the number to the end of the array

Do you know which array method does this?

FCC instructions:
remove the first element of the array.

Do you know which array method does this?

If you are unsure, then you can look back to the previous lessons on push,pop,shift and unshift.

Or you can google how to add an element to the end of an array javascript? how to remove first element from array javascript.

Once you are able to answer those two questions than you have to return the element that was removed.

Hope that helps!

1 Like