I didnt got the question ?..my first case is aproving but next sevrel are failing

I didnt got the question ?..my first case is aproving but next sevrel are failing
0

#1

Tell us what’s happening:

Your code so far

function nextInLine(arr, item) {
   arr[arr.length-1]=arr[0]+arr[arr.length-1];
  
  
  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));
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 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36.

Link to the challenge:


#2

What exactly do you think your line of code above is doing?

All you have to do is add the number (represented by the item argument) to the end of the array, then remove the first element of array and return it.


#3

adding the 1st element to last element


#4

The instructions do not mean add to be mathematical addition. It means you should put the number at the end of the array.

You should review the following two challenges for how to solve this current challenge

Manipulate Arrays With pop()

Manipulate Arrays With shift()


#5

okk…i gt…i"ll look in that way
ty…