title: How to wait to render page with express, while API grabs data?
body: <p>I am trying to load data from the twitter api, getting user information and save that in a temporary array. That array will then be loaded on the page for viewing. The array is getting loaded by the API call, but it doesn't display. </p>
  
  <p>I think I need to use an asynchronous thing like React or Angular, not sure. Would love some input!</p>
  
  <pre><code>function getUserIds (userId) {
      T.get('statuses/retweeters/ids', { id: userId }, function (err, data, response) {
          for(var i = 0; i &lt; data.ids.length; i++){
              ids.push(data.ids[i]);
          }
          getUserInfo();
      });
  }
  function getUserInfo() {
      for(var i = 0; i &lt; ids.length; i++) {
          T.get('users/lookup', { user_id: ids[i] }, function (err, data, response) { 
              names.push(data[0].screen_name);
              pics.push(data[0].profile_image_url_https);
              console.log(names); 
          });
      }
      res.render('display', {names: names, pics:pics});
  }
  </code></pre>