Can somebody give me a hint what to do!?

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

function nextInLine(arr, item) {
// Only change code below this line
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("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/100.0.4896.127 Safari/537.36

Challenge: Stand in Line

Link to the challenge:

Have you tried anything yet?

1 Like

Read the instructions for these carefully. For this exercise, you’ll be modifying the array arr and returning a particular value that it asks for in the question. Good luck!

1 Like

Hi @leonabajrami18 !

Whenever you are stuck on a challenge, it is best to break it up and solve it one step at a time.

The first step is write the code for this part of the directions.
Add the number to the end of the array,

Try writing code for that.
If you get stuck, you can use google to figure out what to use to add numbers at the end of the array.

Once you figure that out, then tackle the second part.
then remove the first element of the array.
The nextInLine function should then return the element that was removed.

Again, if you get stuck try to google what to use to remove the first element of the array.

You can also reply back here with what you have tried and we can help you from there.

Hope that helps!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.