title: How to push the values into array with key name using node.js to construct a json
body: <p>I have a node js code with variables:<br>
      var elements = [];
      var subelement1 = {};
      var subelement2 = {};</p>
  
  <p>How to construct the json with the structure as following:</p>
  
  <pre><code>{
       "elements":[
       "subelement1" :{},
       "subelement2" :{}  
      ]
  }
  </code></pre>