// example
async function getUser() {
console.log("getUser");
const user = await fetch("https://api.uomg.com/api/rand.qinghua").then(
(res) => res.json()
);
console.log("getUser已获取到用户数据user", user);
return user;
}
async function m1() {
console.log("m1");
return await getUser();
}
async function m2() {
console.log("m2");
return await m1();
}
async function m3() {
console.log("m3");
return await m2();
}
async function main() {
console.log("main");
const user = await m3();
console.log("feng", user);
}
main();
In fact ,async function only getUser,but because of it, all subsequent functions become asynchronous.so,How change this?expect your anwser ,Thank u.
In fact ,async function only getUser,but because of it, all subsequent functions become asynchronous.so,How change this?expect your anwser ,Thank u.