title: How to print String after async function with promises
body: <p>I want to print "sentence" String after recognizeFile function have finished to translate from speech to text, i think i should use premises to wait the function to finish but i don't know how to do it. </p>
  
  <pre><code>var button = document.querySelector('#button');
  var recognizeFile = require('watson-speech/speech-to-text/recognize-file');
  var token;
  var sentence;
  button.onclick = function () {
      $.ajax({
          url : "/api/fetch-token",
          type : "GET",
          success : function(token){
              recognizeFile({
                  token: token,
                  file: '/Us_English_Broadband_Sample_1.wav',
                  outputElement: sentence,
                  play: true
              }).then(alert(sentence));
          }
      });
  }
  </code></pre>