title: how do i copy an array correctly
body: <p>im trying to make a copy of an array but when i change the copy it also changes the original.
  i have tried using <code>Object.assign([], scenes)</code>, <code>scenes.clone()</code> and tried using a for loop</p>
  <pre><code>if(localStorage.getItem(saveName) == null){
      var nonLoopScenes = [...scenes];
      nonLoopScenes.forEach(element=&gt;{
          element.objects.forEach(element2=&gt;{
              element2.scene = null;
          });
      });
      console.log(nonLoopScenes);
      console.log(scenes);
      localStorage.setItem(saveName,JSON.stringify(scenes));
  }
  </code></pre>