title: Unable to add elements to an array dynamically
body: <p>I am trying to create a dynamic array and push elements to it using Javascript. Being a beginner, I am having problems with it. </p>
  
  <p>P.S. I am fetching the values all fine (checked with console.log), the only problem is that I am unable to put it in the database.</p>
  
  <p>Below is my code -</p>
  
  <pre><code> (function makelist() {
      var listHeaderData =[];
      var listChildData = [];
      var listImagePath = [];
      var nextPageRefLink = ['imageSlider.html','NewsItem_descp_1.html','http://www.yahoo.com'];
      Parse.initialize("XN0sv3fBqB380fCpwohuHAgansghkiDp8MhbyJDs", "xzoETxUUxicHAtdwqbZh65XtTAFaona3a6cC9jSB");
      console.log("Parse Initailized inside javascript");
      var newsFeed = Parse.Object.extend("NewsFeed");
      var query = new Parse.Query(newsFeed);
      query.find ({
          success: function(results) {
              var output ="";
              for(var  i in results) {
                  //listHeaderData DATA
                  var heading = results[i].get("Heading");
                  listHeaderData.push(heading);
                  console.log("Header : "+heading);
                  //listChildData DATA
                  var description = results[i].get("description");
                  listChildData.push(description);
                  console.log("Description : "+description);
                  if(results[i].get("Image")) {
                      var file = results[i].get("Image");
                      //listImagePath URL's
                      var url = file.url();
                      listImagePath.push(url);
                      console.log("Image URL is:"+url);
                  }
                  console.log("Heading:"+heading);
                  console.log("Description:"+description);
              }
          } , error: function(error){
              console.log("Query error :"+error.message);
          }
      }); 
  }
  </code></pre>
  
  <p>The problem is nothing is getting added to the arrays that I have defined above. I am using .push() function for it. What can be the problem ?</p>