title: Javascript JSON Dynamic Parent
body: <p>I am working on an ionic 1 app, I do not know if there is a way but for example, here, is there a way I can dynamically assign a parent in this JSON object depending on the value of the Variable?</p>
  
  <pre><code>var contact = {
       "Name": "John Doe",
       "available": true,
        Variable: [ 
         {
             "Location": "Home",
             "Number": "33"
         },
         {
             "Location": "Work",
             "Number": "22"
         }
       ]
  };
  </code></pre>
  
  <p>Lets say Variable = "friends"
  Then</p>
  
  <pre><code>var contact = {
       "Name": "John Doe",
       "available": true,
       "Friends": [ 
         {
             "Location": "Home",
             "Number": "33"
         },
         {
             "Location": "Work",
             "Number": "22"
         }
       ]
  };
  </code></pre>