If in doubt, read the documentation:
JavaScript Array splice() Method[
^]
There you will find the cause of your problem:
Quote:
The splice() method overwrites the original array.
A quick test proves that:
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Arrays</h2>
<p>The Array.splice() method adds and removes array elements:</p>
<p id="demo"></p>
<p id="left"></p>
<p id="right"></p>
<script>
var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.getElementById("demo").innerHTML = fruits;
let mid = Math.floor((fruits.length)/2) ;
var right = fruits.splice(mid);
document.getElementById("right").innerHTML = fruits;
var left = fruits.splice(0, mid);
document.getElementById("left").innerHTML = fruits;
</script>
</body>
</html>