title: asynchronous typescript to synchronous typescript
body: <pre><code>postPersonalDetails(pdData){
  let options : RequestOptionsArgs;
  let token:string;
  let id:string;
  this.getToken().then((val) =&gt; {
    token = val;
    console.log("I am in token func"+token);
  });
  this.storage.get('userID').then((val) =&gt; {
    id = val;
    console.log(val);
  });
  console.log("I amhere"+token+id);
  </code></pre>
  
  <p>I am getting the data in 1st consoleLog and 2nd Consolelog</p>
  
  <p>Because of the asynchronous nature 3rd console log is printing first
  there by I am getting token is undefined and user ID is undefined
  What is the right way of doing this?</p>