Stand in Line get stuck half away

function nextInLine (arr, item)
 arr = 10;

 return item;  // Change this line

Write a function nextInLine which takes an array (arr) and a number (item) as arguments.

so that should be:

function nextInLine (arr, item)

then they ask for
Add the number to the end of the array, then remove the first element of the array.

arr = 10;

so arr=array and the last number is 10?

saying arr = 10; will change the array to the number 10, you want to use push to add item to the end and use shift to remove an item from the array hope this helps.

1 Like