async ()
async function test(v) {
return new Promise(resolve => {
setTimeout(() => {
console.log(v);
resolve();
}, 2000);
});
}
console.log('Start');
test(1);
console.log(2);
async function test2() {
await test(3);
console.log(4);
}
test2();
//2
//1
//3
//4