title: Return value from promise in another promise
body: <p>There are quit a lot of questions about how to return value from promises, but I don't see any that answers my question.</p>
  
  <p>this is my function:</p>
  
  <pre><code>function f1(arr, num) {
      return new Promise(function(resolve, reject) {
          resolve(data);
      }).then(function(data){
          f2.then(function(d){
              // how to return d 
          }).catch(...);
  
          function f2(data){
              return new Promise(function(resolve, reject){
                  data = data + 1
                  resolve (data);
              });
          };
      })
      .catch(function(){...});
  }
  </code></pre>
  
  <p>How can I return <code>d</code> in this configuration ?</p>