Stand in Line it says nextInLine is not defined

Tell us what’s happening:
i’ve re-edited this code multiple times and i’m stuck pls help me out

Your code so far

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

// Test Setup
var testArr = [5,6,7,8,9];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 1)); // Modify this line to test
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/74.0.3729.169 Safari/537.36.

Link to the challenge:

It is saying that nextInline is not defined, check capitalization

Also, the second of these calls will tell you that arr.push is not a function, because you don’t have an array as first argument, but a number, and so it is not possible to use array methods on numbers

1 Like

It is not defined, because in these lines of code the name of the function is written incorrectly.

1 Like

i just fixed that thanks, but now it says arr.push()is not a function can you help me fix that too

1 Like

thanks i just fixed it

no worries i just fixed it thanks