title: Loop into an empty array with javascript get query
body: <p>I want to push the results which I get from mysql into an empty array (totalJuice)</p>
  
  <pre><code>var sqlgetgauge = 
  "SELECT juice1_num FROM `customers_out` WHERE MONTH(date)=4 ";
  
     connection.query(sqlgetgauge, function(err, results, field) {
          if (err) throw err;
  
  
          for (i = 0; i &lt; results.length; i++) {
  
  
              var numberjuice1 = Number(results[i].juice1_num / 100);
  
              var totalJuice = [];
  
              totalJuice.push(numberjuice1);
              console.log(totalJuice);
  
              //This is a Gauge Update
              juice_num_1.update({
                  value: numberjuice1,
              });
  
          }
  
  
      });
  </code></pre>
  
  <p>but this code keep showing me result by console.log(totalJuice);</p>
  
  <p>gauge_picker.js:85 [0.5]<br>
  gauge_picker.js:85 [0.02]<br>
  gauge_picker.js:85 [0.02]</p>
  
  <p>I expect array will be [0.5 ,0.02 , 0.02 ]</p>
  
  <p>and additional question is how I get a total of this array?</p>