Reset the code and only input the spread operator part.
One issue with your code is that arr2 is being assigned a value inside of the func in a way where the result of the assignment wont be recognized outside of the func. This makes arr2 remain undefined outside of the func (scope issue)
You do not need to declare arr2 inside the function. Just reassign the value. arr2 is meant to be a global variable. When you declare arr2 inside the function, the global variable arr2 (outside the function) retains its’ original value of undefined.