title: Make non-destructive the splice of JavaScript
body: <p>Is there any way to make the <code>splice()</code> non-destructive?</p>
  
  <p>What I need to do is to retain the <code>arr2</code> as it is after I call the function.</p>
  
  <pre><code>function foo(arr1, arr2, n) {
     let result = arr2;
     result.splice(n, 0, ...arr1.slice(0, arr1.length));
     console.log(arr2);
  }
  
  foo(["I'm", "not", "done"], ["sorry", "yet"], 1);
  </code></pre>
  
  <p>Although it returns <code>sorry,I'm,not,done,yet</code> which is what <strong>I want but the elements of <code>arr2</code> shouldn't change</strong>.</p>