title: I need help to manipulate complex JavaScript Object returned from fire-base
body: <p>I am new to firebase and JavaScript. I am trying to access data from an array of complex object.</p>
  
  <p>I need to access this Date:'02-01-2018' of each record. I get key but do not know how to access the this date. I have shared my database and returned value in screenshot.</p>
  
  <p><a href="https://i.stack.imgur.com/h6wm8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h6wm8.png" alt="This is the firebase data structure."></a></p>
  
  <p><a href="https://i.stack.imgur.com/fsihK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fsihK.png" alt="This is the data returned from database which I have converted into an array."></a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
   "dailyPrices": {
    "01-50005": {
     "04-01-2018": {
      "brands": "",
      "editorID": "janeef@janeef.com",
      "name": "dddf",
      "phone": "",
      "place": "errr"
     },
     "09-01-2018": {
      "brandPriceList": [{
       "brandName": "DC",
       "rsp": "400",
       "stock": "21",
       "supplierChange": "hhhh",
       "supplierRegular": "",
       "wsp": "350"
      }, {
       "brandName": "Barti",
       "rsp": "385",
       "stock": "54",
       "supplierChange": "",
       "supplierRegular": "",
       "wsp": "d380"
      }],
      "brands": "",
      "editorID": "janeef@janeef.com",
      "name": "dddf",
      "orderRequirement": {
       "casualRequirements": "",
       "followUpDate": "",
       "followUpRemarks": "",
       "noOfBags": "",
       "prospectiveness": "",
       "scheduledOrderDate": "",
       "scheduledOrderRemarks": "",
       "urgentRequirementRemarks": "",
       "urgentRequirements": ""
      },
      "phone": "",
      "place": "errr"
     }
    }
   }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input type="text" name="ordDetailTXT" id="ordDetailTXT" value="dailyPrice"&gt;
  </code></pre>
  
  
  
  <p>Code</p>
  
  <pre class="lang-js prettyprint-override"><code>function findOrderDetails(parentKey) 
  {
     var returnArr = [];
        var fetchRecord = database.ref(parentKey);
          fetchRecord.on('value', function(snapshot) {
              var item = snapshot.val();
              item.key = snapshot.key; 
              returnArr.push(item);            
      });
  }
  </code></pre>
  
  
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function btnClickedOrdDetails(){
    var parentkey = ("#ordDetailTXT").val();
  findOrderDetails(parentKey);
  }</code></pre>
  </div>
  </div>
  </p>