async 是 ES7 才有的与异步操作有关的关键字,和 Promise , Generator 有很大关联的。
async function name([param[, param[, ... param]]]) { statements }
name: 函数名称。
param: 要传递给函数的参数的名称。
statements: 函数体语句。
async 函数返回一个 Promise 对象,可以使用 then 方法添加回调函数。
async
function
helloAsync
(
)
{
return
"
helloAsync
"
;
console
.
log
(
helloAsync
(
)
)