title: vuejs copying data object and removing property will remove the property from original object as well
body: <p>I have a data object in vue that looks like this</p>
  
  <pre><code>rows[
  0 {
    title: "my title",
    post: "my post text",
    public: false,
    info: "some info"
  },
  1 {
   title: "my title",
    post: "my post text"
    public: true,
    info: "some info"
  },
  2 {
   title: "my title",
    post: "my post text"
    public: false,
    info: "some info"
  }
  ]
  </code></pre>
  
  <p>I then copy that object and remove certain properties if needed before posting the object to my backend like this:</p>
  
  <pre><code>var postData = this.rows;
        postData.forEach(function(o) {
  
          if (o.public === true) {
            delete o.info;
          }
        });
  
        var uploadData = {};
        uploadData.blogpost = postData;
        axios({
            method: 'post',
            url: myUrl,
            responseType: 'json',
            data: uploadData
          })
  </code></pre>
  
  <p>The problem is that <code>delete o.info;</code> will also remove the property from my <strong>vm</strong> root data, and I dont understand why since I created a new varible/copied the root data into that one. So how can I remove certain object properties from my data before posting it without altering my root data <strong>vm</strong> in vue ?</p>