title: recursively extend json object
body: <p>I have a recursive json structure which contains some properties and a node containing the children, which is the same format as deep as it needs to be. The example below isn't complete or the same as my data, but it shows the rough structure.</p>
  
  <pre><code>[{"page":{
      title: "my title 1",
      children: [
          {"page":{
              title: "my title 2",
              children: [ ... ]
          },{"page":{
              title: "my title 3",
              children: [ ... ]
          },{"page":{
              title: "my title 4",
              children: [
                  {"page": {
                      title: "my other title",
                      children: [ ... ]
                  }]
          },{"page":{
              title: "my title 5",
              children: [ ... ]
          }]
          ... etc
  </code></pre>
  
  <p>I would like to extend the object so that every "page" object gets a new set of properties - e.g. say I want to add <code>{score: 5.3, theme:"moody"}</code> to every "page", so that they all get the properties, such that if I were to stringify the json object each page would then have these properties added.</p>
  
  <pre><code>{"page":{title:"some title", score: 5.3, theme: "moody"}}
  </code></pre>
  
  <p>Is there a way to recursively extend json/object structures, preferably in jQuery?</p>