title: Getting a promise instead the data
body: <p>I'm trying to get a  kind of getter methos using promises , it's working but I get the promise on the return instead of the data , I'm not sure about what is wrong on the code</p>
  <pre><code>function _get_username(){
      var user_promise = new Promise( (resolve, reject) =&gt; {
          $.ajax({
              url:'/get_username',
          }).done(function(data, textStatus, jqXhr){
              console.log(data);
             resolve(data);
          }).fail( function(err){
              reject(err);
          });
      });
  }
  
  async function get_username(){
      try{
          var username = await _get_username();
      }catch(err){
          Swal.fire({
              icon: 'error',
              text: err.message,
            })
      }
      
      return username;
  }
  
  
  console.log(get_username());
  </code></pre>