title: How to merge objects with the same properties into an Array?
body: <p>I would like to merge 2 objects with the same properties into an Array.</p>
  
  <p>Take this for an example:</p>
  
  <pre><code>object1 = {"id":1,
             "name":name1,
             "children":[{"id":2,"name":name2}]
            };
  object2 = {"id":3,
             "name":name3,
             "children":[{"id":4,"name":name4}]
            };
  object3 = {"id":1,
             "name":name1,
             "children":[{"id":6,"name":name6}]
            };
  var result = Object.assign(result,object1,object2,object3);
  </code></pre>
  
  <p>Expected result:</p>
  
  <pre><code>JSON.stringify([result]) =[
                             {"id":1,
                              "name":name1,
                              "children":[{"id":2,"name":name2},
                                         {"id":6,"name":name6}]
                             },
                             {"id":3,
                              "name":name3,
                              "children":[{"id":4,"name":name4}]
                             }
                            ]
  </code></pre>
  
  <p>Actual result:</p>
  
  <pre><code>JSON.stringify([result]) = [
                              {"id":3,
                               "name":name3,
                               "children":[{"id":4,"name":name4}]
                              }
                             ]
  </code></pre>
  
  <p>Seems like Object.assign() isn't the way to go... as it will overwrite, I do not want it to overwrite, I want them to merge instead. Is there a right way to do this?</p>