For this challenge, my code is passing all requirements except for: “All elements from the first array should be added to the second array in their original order.” However, when I console.log(concArr2), I seem to be getting the desired array every time. What am I doing wrong?
but FCC keeps on complaining that The second array should remain the same after the function runs. . please clarify what above solution is failing as per FCC ?
With this you are not making a copy, just a new reference to the same array, so arr2 is still getting modified.
To create a copy you need to use concat(), slice() or the spread operator