async.md

June 11, 2019 ยท View on GitHub

@async Back

The @async tag indicates that a function is asynchronous, which means that the function you called should return a promise.

Note: DO NOT use this tag for other types of asynchronous functions, like functions that provide a callback.

/**
* asynchronous function
* @async
* @returns {Promise<*>}
*/
function asynchronous() {
    return new Promise((resolve, reject) => {});
}

async function main() {
    await asynchronous();
}