Step 57 “Step Inline” is impossible for me to pass.
It says:
Write a function
nextInLine
which takes an array (arr
) and a number (item
) as arguments.
Add the number to the end of the array, then remove the first element of the array.
So I should add function nextInline but there’s one aready on the top? I thought I can’t put two functions one below other one??? It also says to put array and number as arguments to that function. Arrays are in square brackets and numbers after coma and space (numbers like: 1,2,3,4). And in the end
“Add the number to the end of the array, then remove the first element of the array.”
I don’t know how. I don’t know what does it even mean. Since morning for couple hours I was redoing challeneges sinc step 1 again up to 57 and it was much smoother but this still didn’t prepare me for current step.
This is what I wrote:
function nextInLine(arr, item) {
// Only change code below this line
function nextInLine([arr, 5]);
return item;
// Only change code above this line
}
// Setup
const testArr = [1, 2, 3, 4, 5];
// Display code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6));
console.log("After: " + JSON.stringify(testArr));