await 后面跟一个promise对象
async是一个异步函数的标志 async function
let n= await xx() 错误
async function text(){
let n= await xx()
}
await 更像一个同步函数 特征就像是从上向下顺序执行语句
promise 明明显是异步函数 与之不同 与之相比 更加复杂 逻辑性更强
如果同时有多个函数 需要执行 await xx() 或者 await promise.all(f1(), f2())
或者直接 promise.all(f1(), f2()) 全都TRUE为TRUE 全部FALSE 为FALSE
promise.race(f1(), f2()) 一个为TRUE为TRUE 一个为FALSE为FALSE