Tell us what’s happening:
Describe your issue in detail here.
how do i get the function to return 5, its the one step am struggling with, when i try to make modifications to get it to work i them mess up the previous progress
**Your code so far**
function nextInLine(arr, item) {
// Only change code below this line
arr = arr.push(item)
testArr.shift()
return arr;
// 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));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
not gonna lie this is super confusing, all i know is i can use the push function to add an item to the end of an array but the return value that i can’t seem to figure out
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.