title: Why do actiones on concated array effect both arrays after changes?
body: <p>I run the process below to gather all product attributes and options from an object, in order to update a product.</p>
  <p>For some strange reason, the main array categoryUrls get changed, and I can't seem to understand why.</p>
  <p>After the following process, <code>categoryUrls[random key].attributes.options</code> gets new values added.</p>
  <pre><code>const {categoryUrls} = require('./helpers/categoryUrls.js')
  
  getCategory = function (categoryUrls) {
  
      let att = []
      
      for (const key in categoryUrls) {
          if (categoryUrls[key].attributes) {// check if has attribute 
              att = att.concat(categoryUrls[key].attributes)
              
              for(var i=0; i&lt;att.length; ++i) {// check if attribute ID already exist and remove duplicates
                  for(var j=i+1; j&lt;att.length; ++j) {
                      if(att[i].id === att[j].id){
                          for (let k = 0; k &lt; att[j].options.length; k++) { // if attribute ID already exist unite options
                              let exist = att[i].options.find(option =&gt; option == att[j].options[k]) // check if option no already exist 
                              if (!exist) {
                                  att[i].options.push(att[j].options[k])
                              }
                          }
                          att.splice(j--, 1);
                      }
                  }
              }
          }
      }
      return att
  }
  
  
  let data = getCategory(categoryUrls)
  productData = productData.concat(data)
  </code></pre>