function getSomething() {
return "something";
}
async
function testAsync() {
return Promise.resolve("hello async");
}
async
function test() {
const v1 = await getSomething();
const v2 = await testAsync();
console.log(v1, v2); //something 和 hello async
}
test();
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8