function resolveAfter2Seconds(x){ return new Promise(resolve => { setTimeout(() => { resolve(x) }, 2000) });}async function f1() { var x = await resolveAfter2Seconds(10); console.log(x)}f1()
来自慕课:
本文共 260 字,大约阅读时间需要 1 分钟。
function resolveAfter2Seconds(x){ return new Promise(resolve => { setTimeout(() => { resolve(x) }, 2000) });}async function f1() { var x = await resolveAfter2Seconds(10); console.log(x)}f1()
来自慕课:
转载于:https://www.cnblogs.com/aiyr/p/10609960.html