title: Return complete array from Promise
body: <p>I have a function that returns JSON objects using <code>hnews.getById(id)</code>. I then push each story returned in the promise to an array. I'm having trouble figuring out how I'd then get the complete array. Do I need to use another promise?</p>
  <pre><code>function updateTopStories() {
      var storiesArr = [];
  
      hnews.getIdsInCategory('topstories', 60)
      .then(function(ids) {
          ids.forEach(function(id) {
              hnews.getById(id).then(function(story) {
                  console.log(story);
                  storiesArr.push(story);
              });
          });
      });
  
      return storiesArr;
  }
  
  var stories = updateTopStories();
  console.log(stories); // Empty array
  </code></pre>
  <p>EDIT: I need to return <code>storiesArr</code> from <code>updateTopStories();</code></p>