title: JS issue with creating an array copy
body: <p>I'm trying to add properties and flatmap and make changes to the array
  without changing the original array(data).
  I'm using this method in 2 places from a one dispatch call in vue js when i'm passing the data from parent tp children.</p>
  <ul>
  <li>When i'm using the method for the first time every thing is ok, but when i'm using the array the second time in different child component :* it seems like the first it did made changes to the original data
  and i don't want to make any changes to the original array.
  (JS AND VUE JS &amp; TS)</li>
  </ul>
  <pre><code>public mapJson(data:any){
              let copyData:any = [...data]
  
              const newObjects:Array&lt;MetaObject&gt; = [];
              const cb = (e) =&gt; {
              let elemnt: any = {...e};
  
              if(elemnt.item.parentId.value === 0){
                  elemnt.item.parentId.value = null;
              }
        
                  if(elemnt.item.idOnScene){
                      let split = elemnt.item.idOnScene.split(&quot;|&quot;);
                      elemnt.item.modelId = elemnt.item.id.value;
                      elemnt.item.id.value = split[2];
                      elemnt.item.name = split[1];
                      elemnt.item.type = split[0];
                  }
                  else{
                      elemnt.item.modelId = elemnt.item.id.value;
                  }
  
              let newMeta = {
                  id: elemnt.item.id.value,
                  name: elemnt.item.name,
                  type: elemnt.item.name,
                  parent: elemnt.item.parentId.value,
                  modelId: elemnt.item.modelId
              }
              newObjects.push(newMeta);
  
              e.children &amp;&amp; e.children.forEach(cb);
          }
          copyData.forEach(cb);
  
          const newData : Metadata = {
              id: &quot;&quot;,
              projectId: &quot;2GcXDGLMXA_8_$wW69Hy7E&quot;,
              author: &quot;&quot;,
              createdAt: &quot;2019-01-21T13:24:08&quot;,
              schema: &quot;IFC2X3&quot;,
              creatingApplication: &quot;20181011_1500(x64) - Exporter 18.4.0.0 - Alternate UI 18.4.0.0&quot;,
              metaObjects: newObjects
          };
  
          return newData;
          }
  </code></pre>