Stand in Line 1

Tell us what’s happening:
i dont understand the phrase "New items can be added at the back of the queue and old items are taken off from the front of the queue" means…

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:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 11021.81.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/stand-in-line

As arguments of your function you have one array and one item, you remove first item of array, and add the given item to the end of it
Does this explain it better?

front-> [1, 2, 4, 8] <-back

A queue is just an abstraction, it’s just an array. Look at the Mutator methods on the Array.prototype, see if you can find which of the methods that does what you need.