Stand in Line i did not get this

Stand in Line i did not get this
0

#1

Tell us what’s happening:

Your code so far

function nextInLine(arr, item) {
  // Your code here
  
  return item;  // 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));

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36.

Link to the challenge:


#2

Your function has to do these things:

  • Append item to the arr array.
  • Remove the first item from the array.
  • Return that item.

Suppose the input array is [1,2,3,4,5] and item is 6, the function’s return value should be 1 (the first item). And the input array should now be [2,3,4,5,6] after that.


#3

thank you.now i understood…


#4

I am stuck with this problem, i cant understood what is the scenario, can you give the example of it… how to write the code here.