title: Change the nested objects key recursively
body: <p>I have object like this there are many keys named <code>label</code> <code>choices</code></p>
  <pre><code>obj = 
  {
   &quot;label&quot;:&quot;mylabel&quot;,
   &quot;choices:[
      {
        &quot;label&quot;:&quot;mylabel_11&quot;,
        &quot;choices&quot;:{
           &quot;label&quot;:&quot;mylabel_12&quot;,
           &quot;choices&quot;:[...]
         }
      },{
        &quot;label&quot;:&quot;mylabel_21&quot;,
        &quot;choices&quot;:{
           &quot;label&quot;:&quot;mylabel_22&quot;,
           &quot;choices&quot;:[...]
         }
      },
    ]
  }
  </code></pre>
  <p>Now I want to to change all &quot;label&quot; to &quot;name&quot;, &quot;choices&quot; to &quot;children&quot;</p>
  <p>Is there any recursive way to replace the name?</p>
  <p>Currently my idea is</p>
  <pre><code>var new_keys;
  for (key in obj){
      var old_key = key;
      key = key.replace(&quot;label&quot;,&quot;name&quot;);
      key = key.replace(&quot;choices&quot;,&quot;children&quot;);
      new_keys[key] = obj[old_key]
  }
  </code></pre>
  <p>How can I make this recursive?</p>