jsbayes.js
function async(f, args) {
    return new Promise(
      function(resolve, reject) {
        try {
          var r = f.apply(undefined, args);
          resolve(r);
        } catch(e) {
          reject(e);
        }
      }
    );
  }
function async(f, args) {
    return new Promise(
      function(resolve, reject) {
        try {
          var r = f.apply(undefined, args);
          resolve(r);
        } catch(e) {
          reject(e);
        }
      }
    );
  }
function async ( f , args ) { return new Promise ( function ( resolve , reject ) { try { var r = f . apply ( undefined , args ) ; resolve ( r ) ; } catch ( e ) { reject ( e ) ; } } ) ; }
Creates a Promise.
@param {Object} f Function.
@param {Array} args List of arguments.
@returns {Promise} Promise.
Creates a Promise .