title: Convert async/await style to traditional .then style
body: <p>Consider the following code example, I will attempt to get the result in two ways, if <code>methodA</code> does not give me the expected result, I will try <code>methodB</code>.</p>
  
  <pre><code>function methodA () {
      console.log('called A');
      return Promise.resolve('not result');
  }
  
  function methodB () {
      console.log('called B');
      return Promise.resolve('result');
  }
  
  function isValid (result) {
      return result === 'result';
  }
  
  async function getResult () {
    let result = await methodA();
    if (!isValid(result)) result = await methodB();
    console.log('result', result);
  }
  </code></pre>
  
  <p>I want to use the traditional <code>.then</code> style to handle the async functions.</p>
  
  <pre><code>function getResult () {
    return methodA()
    .then((result) =&gt; {
      if (isValid(result)) return result;
      return methodB();
    })
    .then((result) =&gt; {
      console.log('result', result);
    });
  }
  </code></pre>
  
  <p>I may add more methods (<code>methodC</code>, <code>methodD</code>...) in the future.</p>
  
  <p>Is there a way to make <code>getResult</code> look cleaner?</p>
  
  <p><a href="https://jsfiddle.net/mkrb87Lo/5/" rel="nofollow noreferrer">JSFiddle</a></p>