title: How to neatly chain promises in Javascript
body: <p>How can I write this function neater, is returning then resolving it in the timeout callback the best way to do this? I'm asking because I'm new to javascript promises.</p>
  
  <pre><code>getStuff(): Promise&lt;any&gt; {
      let self = this;
  
      return new Promise(function(resolve, reject) {
          self.getData()
              .then(function(resp) {
                  self.parse(resp);
              })
              .then(function() {
                  setTimeout(function() {                                 
                      resolve();
                  }, 5000);
              });
      });  
  }
  </code></pre>