Simon Priet 9e2991e668 init
2021-09-05 22:53:58 +02:00

9 lines
201 B
JavaScript

function f (x) { return new Promise(resolve => {
process.nextTick(() => { resolve(x) }) }) }
async function add (x) {
return x + await f(20) + await f(30)
}
add(10).then(v => { console.log(v) })