title: Append object to child object in javascript
body: <p>I have the following object:</p>
  
  <pre><code>var dpsets = {
      "routes": [
          {
              "name": "first",
              "values": [
                  "info",
                  "more info",
                  "text"
              ]
          },
          {
              "name": "second",
              "values": [
                  "text again",
                  "with info"
  
              ]
          }
      ]
  }
  </code></pre>
  
  <p>I also have the following object:</p>
  
  <pre><code>var currentSet = {
      "name": "New Route",
      "values": [
          "Latest one",
          "Latest two"
      ]
  }
  </code></pre>
  
  <p>I am trying to append <code>currentSet</code> to the <code>routes</code> element of <code>dpsets</code>.</p>
  
  <p>I have tried both <code>dpsets.routes.push(currentSet)</code> and jQuery's <code>$.extend(dplocations.routes, currentRoute)</code> but neither seemed to do what I require.</p>
  
  <p>What's the best way to do it?</p>