The reason its because you cannot assign newarr into ourrarr variable bacause the right hand side will evealute first and assign the value and return of that splice.
if you want to assing newarr into a variable ourrarr you will have to do this.
let newarr = arr2.slice();
newarr.splice(n, 0, ...arr1);
let ourarr = newarr; // Here you are assigning your result splice into a variable.
return ourarr;