basic/Vanilla.js
promise
ekgoddldi
2021. 5. 31. 19:14
function a() { return new Promise(resolve => { setTimeout(() => { console.log('A') resolve() }, 1000); }) } async function test2017() { await a() console.log('B') } function test2015() { a().then(() => { console.log('B') }) } test2017() test2015() |