title: In JS, why does the slice() documentation say it is a shallow copy when it looks like a deep copy?
body: <p>According to the docs for <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice" rel="nofollow noreferrer"><code>Array.prototype.slice()</code></a> in JavaScript, the <code>slice()</code> method returns a shallow copy of a portion of an array into a new array. It is my understanding that a shallow copy will only copy top level elements in an array and will not copy nested elements. However, when I run a test in my browser console, it sure looks like the <code>slice()</code> method is actually copying the nested elements (deep copying).</p>
  
  <p><a href="https://i.stack.imgur.com/dt5H5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dt5H5.png" alt="enter image description here"></a></p>
  
  <p>Where am I misunderstanding the concept of a deep copy? Please help me clarify as it relates to my exact example.</p>
  
  <pre><code>var array = [1,2,[3,4,[5,6]]];
  var array2 = array.slice();
  </code></pre>