title: Looping a javascript promise to append to an array
body: <p>Good day, below I have </p>
  
  <pre><code>    var request = require('request');
      getFood = function(lst){
          return new Promise(function(resolve, reject){
              //console.log(lst)
              request('https://api.jamesoff.net/recipe', function (error, response, recipe) {
                  lst.push(JSON.parse(recipe))
                  resolve(lst);
              })
          });
      }   
  
  
      getFood([]).then(function(data){
          for(var i = 0; i &lt; 3; i++){
              getFood(data)
          }
          return(data);
      }).then(function(data){
          console.log(data)
      })
  </code></pre>
  
  <p>What I am aiming to accomplish is by using a promise chain place three recipies into an array using a loop. I only get one item and I know why this occurs, however I can't wrap my head around the procedure to accomplish my goal. Could I please get an explanation with code?</p>