Stand in Lin. how to complete this task any one please give me an idea

Tell us what’s happening:

Your code so far

function nextInLine(arr, item) {
  // Your code here
  var arr  = [1,2,3,4,5];
  var removed = arr.shift();
  return removed;  // Change this line

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine([2], 1)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36.

Link to the challenge:

Two problems here.

var arr  = [1,2,3,4,5];

Why are you putting this in your function? The point is that arr should be passed into the function.



You are using square brackets here instead of parentheses. You use square brackets to access individual cells of the array. But you want push a method (function) of the array.

When I make those changes, your code passes.