Stand in Line - help . Im stuck

Stand in Line - help . Im stuck
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:

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

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


#2

Hello there, Immanuel-john! It looks like you’ve provided the original code template. I’d be happy to see if I can help if you can elaborate more on that issues that you’re facing. In this challenge, I would recommend looking at the different array methods on Mozilla Developer Network to see if any fit what the challenge requires. There may be a method that is used to add something to the end of an array and another method that is used to remove an item from an array.