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
p {
float: right;
width: 250px;
}
figure {
animation: imageAnimation 3s linear infinite 0s;
}
figure:nth-child(3) {
animation-delay: 2s;
}