title: Promise inside promise: what's the correct way to return a variable from the child promise? (JS)
body: <p>I've a function like this:</p>
  
  <pre><code>function top() {
  
    //promise1
    ParentPromise({
      ...some code here...
    }).then(function() {
  
  
      //promise2
          ChildPromise({
            ..some code here...
          }).then(function(response) {
           var result = response.result.items;
  
          });
  
  });
  
  };
  </code></pre>
  
  <p>and i need to return result value in this way:</p>
  
  <pre><code>var myresult = start();
  </code></pre>
  
  <p>How i can do that? THX</p>