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
testArr[4]=item
return arr[0] |item;
// Only change code above this line
my code is only getting the value of item not arr , I tried to solve but still not working properly.
console.log(JSON.stringify([2], 1))
console.log(nextInLine([5,6,7,8,9], 1))
these two lines are causing problem first should return 2 but it returns [2] sometimes 3 and the second is working but doesn't making sense to me how ,cause it should return 5 according to my understanding return arr should be arr[0][0] but its working with arr[0]
also console.log(nextInLine(testArr, 10)) it should return 10 but it returns 11
}
// Setup
const testArr = [1, 2, 3, 4, 5];
console.log(nextInLine([], 5))
console.log(nextInLine([], 1))
console.log(JSON.stringify([2], 1))
console.log(nextInLine([5,6,7,8,9], 1))
console.log(nextInLine(testArr, 10))
// 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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15