Need help with this Code! ;-(

Everytime I try to input my code, it says “SyntaxError”. Is there something wrong with my code??? Any help is appreciated!

function nextInLine(arr, item) {
  // Only change code below this line
arr.push(item);
return arr.shift[];
  // Only change code above this line
  

}

// Setup
var 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));

This is not correct syntax. You are using square brackets ([]).

1 Like

@ArielLeslie, thank you! :pray: :grinning_face_with_smiling_eyes: :exploding_head: That was the problem! These () were the correct brackets. I forgot to check that.

I’m glad I could help. Happy coding!

1 Like

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