I always thought async functions need to contain "await" keyword inside, for example:(我一直认为异步函数需要在其中包含“ await”关键字,例如:)
async function doTask() {
let total = await CustomFunction(values);
console.log(`Main Total: ${total}`);
}
doTask();
But I also saw some like that define async function without having await as:(但我也看到了一些类似的定义异步功能而不必等待的情况:)
GetData = async ( method, url, params) =>
{
Axios.request({
method, url, params
});
}
so what's the point to have async keyword added in front of a function that doesn't have "await" keyword?(那么在没有“ await”关键字的函数前面添加async关键字有什么意义呢?)
ask by secondimage translate from so