标签:eject code mis done function one val rom div
async function firstAsync () { return 27 //return Promise.resolve(27) } firstAsync().then(val => { console.log(val) }) console.log(firstAsync() instanceof Promise) //true async function fun () { let promise = new Promise((resolve,reject) => { setTimeout(function () { resolve(‘now it is done‘) },1000) }) console.log(await promise) console.log(await Promise.resolve(40)) console.log(2) return Promise.resolve(3) } fun().then(val => { console.log(val) })
标签:eject code mis done function one val rom div
原文地址:https://www.cnblogs.com/qjb2404/p/12231266.html